Search Results

Search found 1573 results on 63 pages for 'adam lane'.

Page 51/63 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • need help understanding a function.

    - by Adam McC
    i had previously asked for help writing/improving a function that i need to calculate a premium based on differing values for each month. the premium is split in to 12 months and earned on a percentage for each month. so if the policy start in march and we are in jan we will have earned 10 months worth. so i need to add up the monthly earning to give us the total earned. wach company wil have differeing earnings values for each month. my original code is Here. its ghastly and slow hence the request for help. and i was presented with the following code. the code works but returns stupendously large figures. begin set @begin=datepart(month,@outdate) set @end=datepart(month,@experiencedate) ;with a as ( select *, case calmonth when 'january' then 1 when 'february' then 2 when 'march' then 3 when 'april' then 4 when 'may' then 5 when 'june' then 6 when 'july' then 7 when 'august' then 8 when 'september' then 9 when 'october' then 10 when 'november' then 11 when 'december' then 12 end as Mnth from tblearningpatterns where clientname=@client and earningpattern=@pattern ) , b as ( select earningvalue, Mnth, earningvalue as Ttl from a where Mnth=@begin union all select a.earningvalue, a.Mnth, cast(b.Ttl*a.earningvalue as decimal(15,3)) as Ttl from a inner join b on a.Mnth=b.Mnth+1 where a.Mnth<=@end ) select @earningvalue= Ttl from b inner join ( select max(Mnth) as Mnth from b ) c on b.Mnth=c.Mnth option(maxrecursion 12) SET @earnedpremium = @earningvalue*@premium end can someone please help me out?

    Read the article

  • Rails and a development domain

    - by Adam
    I'm trying to use http://ls1.bigseapreview.com as a domain for a Rails project. The problem is it doesn't seem to be correctly mapping any routing apart from the home page. I have added /about but you can see that you will just get a 404, but it works locally. What do I have to do to fix this?

    Read the article

  • Footprint of Lua on a PPC Micro

    - by Adam Shiemke
    We're developing some code on Freescale PPC micros (5517 and 5668 at the moment), and I was wondering if we could put Lua on them. The devices need to be easily programmed/reconfigured in the field, and the current product uses a proprietary interpreted logic language that can be loaded in, and our software (written in C) runs an interpreter. I would like to move to a better language (the implementation is a bit buggy and slow), so I'm considering Lua, but the memory footprint must be very low. For the 5517 (which we may not use), the maximum RAM is 80K. Things are better on the 5668, with 592K of RAM. So does anyone know if I can put Lua on bare metal? We're effectively not running an OS. If so, are there any estimates on what kind of memory footprint we might see? How much effort it would take? Failing this, does anyone know of any kind of interpreter that might be better in a memory-constrained environment without an OS? Or are we better just rolling our own?

    Read the article

  • Regular Expression to match a string

    - by Adam Witko
    Hi, I've got two possible string inputs that my application will receive, and if it matches the following two strings, I need it regex.ismatch() to return true: "User * has logged out" "User * has joined" I'm not that good at regex and just can't figure out how to go about matching the above. Any help would be great!!!

    Read the article

  • Upcasting in C#: Making a Fruit a Pear

    - by Adam Kane
    Why can't I upcast (?) a Fruit to a Pear? public static class PearGenerator { public static Pear CreatePear () { // Make a new generic fruit. Fruit genericFruit = new Fruit(); // Upcast it to a pear. (Throws exception: Can't cast a Fruit to a Pear.) Pear pear = (Pear)genericFruit; // Return freshly grown pear. return ( pear ); } } public class Fruit { // some code } public class Pear : Fruit { public void PutInPie () { // some code } } Thanks!

    Read the article

  • hibernate.properties classpath conflict

    - by Adam B
    I have a jar on the classpath which contains a hibernate.properties. This causes problems when my app starts because hibernate tries to use the settings from this file. Is there a way to explicitly specify the file that hibernate should look for, or tell it to ignore the properties file in the dependency jar?

    Read the article

  • Ruby On Rails -

    - by Adam S
    I am trying to create a collection_select that is dependent on another collection_select, following the railscasts episode #88.. The database includes a schedule of all cruise ships arrival dates. See attached schema diagram,... (The arrow side of the lines indicate has_many, the non-pointy side indicates belongs_to) In the "booking/new" view I have a collection_select for choosing a cruiseline, then another collection_select will appear for selecting a ship, then another for selecting the date that ship is in. If I ONLY put a collection_select for shipshedule it works fine(because of the direct association with the bookings model). However, if I try to add a collection_select for cruiselines....it breaks(Im assuming because their isnt a direct association). The collection_select for cruiselines returns an undefined method error for "cruiseline_id".....if I simply use "id" the collection_select works, but of course isnt fully functional due to incorrect naming of the form field. I have tried "has_many :shipschedules, :through = :cruiseships" in the cruiseline model and "has_many :bookings, :through = :shipschedules" in the cruiseships model... As you can see in the diagram, I need to access the cruiseships and cruiselines model through the bookings model. I have the models set up so a cruiseline has_many cruiseships, a cruiseship has_many shipschedules, and a shipschedule has_many bookings. But, the bookings model cant directly access the cruiseline model. How do I accomplish this? THANKS!!! http://www.adamstockland.com/common/images/RoRf/PastedGraphic-2.png http://www.adamstockland.com/common/images/RoRf/PastedGraphic-1.png

    Read the article

  • Replacing multiple `-` with one `-` without regexp

    - by Adam Kiss
    I've seen so many misuses of RegExp, I don't really like it :) I have string (as a result of two str_replaces) that might look something like this: .?This iš my ".stRiNg."! | V --this-is-my---string--- Is there any way better than $string = trim(preg_replace('/[-]+/u','-', $string),'-'); to get: this-is-my-string ?

    Read the article

  • How do you deal with breaking changes in a Rails migration?

    - by Adam Lassek
    Let's say I'm starting out with this model: class Location < ActiveRecord::Base attr_accessible :company_name, :location_name end Now I want to refactor one of the values into an associated model. class CreateCompanies < ActiveRecord::Migration def self.up create_table :companies do |t| t.string :name, :null => false t.timestamps end add_column :locations, :company_id, :integer, :null => false end def self.down drop_table :companies remove_column :locations, :company_id end end class Location < ActiveRecord::Base attr_accessible :location_name belongs_to :company end class Company < ActiveRecord::Base has_many :locations end This all works fine during development, since I'm doing everything a step at a time; but if I try deploying this to my staging environment, I run into trouble. The problem is that since my code has already changed to reflect the migration, it causes the environment to crash when it attempts to run the migration. Has anyone else dealt with this problem? Am I resigned to splitting my deployment up into multiple steps?

    Read the article

  • C# directory to "play with"

    - by Adam S
    Simple question here. I have a C# program which needs to stores some files onto the hard drive, but I don't need them to be anywhere useful to the end-user, only somewhere that the program can read/write from. Is there a directory that I can reference programmatically to be my "filespace playground" - that is, that I can read/write freely to and from? EDIT: Also, if I use a temp directory, how long are the files guaranteed to be there? I don't want the them to disappear while my program is still running!

    Read the article

  • GPS format in PHP

    - by Adam
    Hello, how made in PHP from format 52.593800, 21.448850 format +52° 35' 37.68", +21° 26' 55.86" like do it google http://maps.google.pl/maps?hl=pl&t=m&q=52.593800,21.448850 ?

    Read the article

  • Sort vector<int>(n) in O(n) time using O(m) space?

    - by Adam
    I have a vector<unsigned int> vec of size n. Each element in vec is in the range [0, m], no duplicates, and I want to sort vec. Is it possible to do better than O(n log n) time if you're allowed to use O(m) space? In the average case m is much larger than n, in the worst case m == n. Ideally I want something O(n). I get the feeling that there's a bucket sort-ish way to do this: unsigned int aux[m]; aux[vec[i]] = i; Somehow extract the permutation and permute vec. I'm stuck on how to do 3. In my application m is on the order of 16k. However this sort is in the inner loops and accounts for a significant portion of my runtime.

    Read the article

  • Excel function advanced filter

    - by Adam
    I have a list of sales people and a list of their sale revenues in two separate columns. How do I use an advanced filter or other sorting means to find the max of the sale revenue column and then have the formula output be the corresponding sales person?

    Read the article

  • Classification question

    - by adam
    If php and ruby are languages, and cake and rails are frameworks, how do CMS like drupal and joomla fit into the scheme... can you use them in any language and any framework?

    Read the article

  • Organizing c# code into different files

    - by Adam S
    Hi everyone. I've gotten to a point where my main code file is about a thousand lines long and it's getting un-manageable; that is, I'm starting to get confused and not know where to locate some things. It's well-commented but there's just too much stuff. I'd really like to be able to organize my code into different files, each with its own purpose. I want to get all the help VS gives me as I type when I edit these other files. A picture can say a thousand words: Is what I'm trying to do even possible?

    Read the article

  • Loop through array, print with string.

    - by Adam
    I have a simple array like: var myArr=["one","two","three"]; an I have a counting loop, which increases the value of var i by one. What I want to do is print the next value from the array each time the loop runs, next to a text string, like so: alert('value number '+myArr[i]+); But for some reason I can't get this to work. The following code works, so I'm assuming I'm not calling the counter right: alert('value number '+myArr[0]+);

    Read the article

  • how do i detect \r\n in a u_char type of buffer?

    - by aDi Adam
    i am trying to construct http content from packet sniffing in C. right now i am able to save all the packets in a file but i want to get rid of the headers in the first packet. they are also being saved as per they are a part of tcp payload. the actual body after the header starts after double "crlf" or \r\n\r\n in http response. how do i detect \r\n so that i can only save the following part of the buffer in the file. the buffer is u_char type. i cant figure out the command or the part i looked on google and other places but i mostly find c# commands, nothing in C.

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >