Search Results

Search found 870 results on 35 pages for 'allocation'.

Page 13/35 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • The difference between delete and delete [] in C++

    - by Ilya Melamed
    I've written a class that contains two pointers, one is char* color_ and one in vertexesset* vertex_ where vertexesset is a class I created. In the destractor I've written at start delete [] color_; delete [] vertex_; When It came to the destructor it gave me a segmentation fault. Then I changed the destructor to: delete [] color_; delete vertex_; And now it works fine. What is the difference between the two?

    Read the article

  • .NET DB Query Without Allocations?

    - by Michael Covelli
    I have been given the task of re-writing some libraries written in C# so that there are no allocations once startup is completed. I just got to one project that does some DB queries over an OdbcConnection every 30 seconds. I've always just used .ExecuteReader() which creates an OdbcDataReader. Is there any pattern (like the SocketAsyncEventArgs socket pattern) that lets you re-use your own OdbcDataReader? Or some other clever way to avoid allocations? I haven't bothered to learn LINQ since all the dbs at work are Oracle based and the last I checked, there was no official Linq To Oracle provider. But if there's a way to do this in Linq, I could use one of the third-party ones.

    Read the article

  • Static vs. dynamic memory allocation - lots of constant objects, only small part of them used at runtime

    - by k29
    Here are two options: Option 1: enum QuizCategory { CATEGORY_1(new MyCollection<Question>() .add(Question.QUESTION_A) .add(Question.QUESTION_B) .add...), CATEGORY_2(new MyCollection<Question>() .add(Question.QUESTION_B) .add(Question.QUESTION_C) .add...), ... ; public MyCollection<Question> collection; private QuizCategory(MyCollection<Question> collection) { this.collection = collection; } public Question getRandom() { return collection.getRandomQuestion(); } } Option 2: enum QuizCategory2 { CATEGORY_1 { @Override protected MyCollection<Question> populateWithQuestions() { return new MyCollection<Question>() .add(Question.QUESTION_A) .add(Question.QUESTION_B) .add...; } }, CATEGORY_2 { @Override protected MyCollection<Question> populateWithQuestions() { return new MyCollection<Question>() .add(Question.QUESTION_B) .add(Question.QUESTION_C) .add...; } }; public Question getRandom() { MyCollection<Question> collection = populateWithQuestions(); return collection.getRandomQuestion(); } protected abstract MyCollection<Question> populateWithQuestions(); } There will be around 1000 categories, each containing 10 - 300 questions (100 on average). At runtime typically only 10 categories and 30 questions will be used. Each question is itself an enum constant (with its fields and methods). I'm trying to decide between those two options in the mobile application context. I haven't done any measurements since I have yet to write the questions and would like to gather more information before committing to one or another option. As far as I understand: (a) Option 1 will perform better since there will be no need to populate the collection and then garbage-collect the questions; (b) Option 1 will require extra memory: 1000 categories x 100 questions x 4 bytes for each reference = 400 Kb, which is not significant. So I'm leaning to Option 1, but just wondered if I'm correct in my assumptions and not missing something important? Perhaps someone has faced a similar dilemma? Or perhaps it doesn't actually matter that much?

    Read the article

  • How is dynamic memory allocation handled when extreme reliability is required?

    - by sharptooth
    Looks like dynamic memory allocation without garbage collection is a way to disaster. Dangling pointers there, memory leaks here. Very easy to plant an error that is sometimes hard to find and that has severe consequences. How are these problems addressed when mission-critical programs are written? I mean if I write a program that controls a spaceship like Voyager 1 that has to run for years and leave a smallest leak that leak can accumulate and halt the program sooner or later and when that happens it translates into epic fail. How is dynamic memory allocation handled when a program needs to be extremely reliable?

    Read the article

  • page allocation failure - am I running out of memory?

    - by mfriedman
    Lately I've noticing entries like this one in the kern.log of one of my servers: Feb 16 00:24:05 aramis kernel: swapper: page allocation failure. order:0, mode:0x20 This is what I'd like to know: What exactly does that message mean? Is my server running out of memory? The swap usage is quite low (less than 10%), and so far I haven't noticed any processes being killed because of lack of memory. Additional information: The server is a Xen instance (DomU) running Debian 6.0 It has 512 MB of RAM and a 512 MB swap partition CPU load inside the virtual machine shows an average of 0.25

    Read the article

  • Running an allocation simulation repeatedly breaks after the first run.

    - by Az
    Background I have a bunch of students, their desired projects and the supervisors for the respective projects. I'm running a battery of simulations to see which projects the students end up with, which will allow me to get some useful statistics required for feedback. So, this is essentially a Monte-Carlo simulation where I'm randomising the list of students and then iterating through it, allocating projects until I hit the end of the list. Then the process is repeated again. Note that, within a single session, after each successful allocation of a project the following take place: + the project is set to allocated and cannot be given to another student + the supervisor has a fixed quota of students he can supervise. This is decremented by 1 + Once the quota hits 0, all the projects from that supervisor become blocked and this has the same effect as a project being allocated Code def resetData(): for student in students.itervalues(): student.allocated_project = None for supervisor in supervisors.itervalues(): supervisor.quota = 0 for project in projects.itervalues(): project.allocated = False project.blocked = False The role of resetData() is to "reset" certain bits of the data. For example, when a project is successfully allocated, project.allocated for that project is flipped to True. While that's useful for a single run, for the next run I need to be deallocated. Above I'm iterating through thee three dictionaries - one each for students, projects and supervisors - where the information is stored. The next bit is the "Monte-Carlo" simulation for the allocation algorithm. sesh_id = 1 for trial in range(50): for id in randomiseStudents(1): stud_id = id student = students[id] if not student.preferences: # Ignoring the students who've not entered any preferences for rank in ranks: temp_proj = random.choice(list(student.preferences[rank])) if not (temp_proj.allocated or temp_proj.blocked): alloc_proj = student.allocated_proj_ref = temp_proj.proj_id alloc_proj_rank = student.allocated_rank = rank successActions(temp_proj) temp_alloc = Allocated(sesh_id, stud_id, alloc_proj, alloc_proj_rank) print temp_alloc # Explained break sesh_id += 1 resetData() # Refer to def resetData() above All randomiseStudents(1) does is randomise the order of students. Allocated is a class defined as such: class Allocated(object): def __init__(self, sesh_id, stud_id, alloc_proj, alloc_proj_rank): self.sesh_id = sesh_id self.stud_id = stud_id self.alloc_proj = alloc_proj self.alloc_proj_rank = alloc_proj_rank def __repr__(self): return str(self) def __str__(self): return "%s - Student: %s (Project: %s - Rank: %s)" %(self.sesh_id, self.stud_id, self.alloc_proj, self.alloc_proj_rank) Output and problem Now if I run this I get an output such as this (truncated): 1 - Student: 7720 (Project: 1100241 - Rank: 1) 1 - Student: 7832 (Project: 1100339 - Rank: 1) 1 - Student: 7743 (Project: 1100359 - Rank: 1) 1 - Student: 7820 (Project: 1100261 - Rank: 2) 1 - Student: 7829 (Project: 1100270 - Rank: 1) . . . 1 - Student: 7822 (Project: 1100280 - Rank: 1) 1 - Student: 7792 (Project: 1100141 - Rank: 7) 2 - Student: 7739 (Project: 1100267 - Rank: 1) 3 - Student: 7806 (Project: 1100272 - Rank: 1) . . . 45 - Student: 7806 (Project: 1100272 - Rank: 1) 46 - Student: 7714 (Project: 1100317 - Rank: 1) 47 - Student: 7930 (Project: 1100343 - Rank: 1) 48 - Student: 7757 (Project: 1100358 - Rank: 1) 49 - Student: 7759 (Project: 1100269 - Rank: 1) 50 - Student: 7778 (Project: 1100301 - Rank: 1) Basically, it works perfectly for the first run, but on subsequent runs leading upto the nth run, in this case 50, only a single student-project allocation pair is returned. Thus, the main issue I'm having trouble with is figuring out what is causing this anomalous behaviour especially since the first run works smoothly. Thanks in advance, Az

    Read the article

  • Setting Windows 7's Recycle Bin to automatically have a default disk space allocation for deleted files from newly mounted drives

    - by galacticninja
    How do I set Windows 7's Recycle Bin to automatically have a default disk space allocation for deleted files from external hard drives and TrueCrypt-mounted volumes? I remember in Windows XP, I can set a percentage of total disk space that will automatically be used as storage capacity for deleted files by the Recycle Bin, and this will be applied to all external HDs or TC-mounted volumes. Windows 7 defaults to the 'Don't move files to the Recycle Bin. Remove files immediately when deleted' setting for newly mounted external HDs and TC mounted volumes. Since I am expecting deleted files to go to the Recycle Bin, sometimes this causes an 'Oops' when I delete files in external hard drives or TC mounted volumes, as Windows does not move deleted files to the Recycle Bin, but just deletes the files permanently. I have to remember to manually set a custom Recycle Bin storage space for each new drive that is mounted by Windows to avoid this issue. I only use and mount TrueCrypt file containers, not drives. I also don't mount TrueCrypt file containers as removable drives. ('Mount volume as removable medium' is unchecked in Mount Options.) In my $Recycle.Bin > Properties > Security settings, 'System' and 'Administrators' are already set to 'Full Control', while 'Users' only have 'Special Permissions' checked in gray. There are no other groups. I haven't changed or edited anything in these settings. I am using Windows 7 Ultimate.

    Read the article

  • How to configure CISCO switch 2960 for port-based address allocation on a single port only?

    - by Jack
    CISCO 2960 allows you to configure so-called Port-Based address allocation. It makes the switch to associate IP address it is giving out via DHCP with port-identifier, which is random, switch created identifier. In practice it means that any machine connected to such configured port will always get the same IP address, regardless of what that machine's MAC address is. I want to have that feature configured on --some ports-- only. But no matter what commands I try it seems that this can only be done for all ports, all for none. Even though CISCO manual seems to indicate there's both global and per-port command to enable that. Here are relevant commands from CISCO manual: configure terminal ip dhcp use subscriber-id client-id (this configures the DHCP server to globally use the subscriber ID as the client ID on all incoming DHCP messages) interface FastEthernet0/1 ip dhcp server use subscriber-id client-id (Optional: Configures the DHCP server to use the subscriber ID as the client ID on all incoming DHCP messages on the interface) but it appears if I configure only per-interface than there's no effect at all, if I configure globally and per interface - CISCo behaves as if all ports were configured to use that feature. Any ideas?

    Read the article

  • regex to break a string into "key" / "value" pairs when # of pairs is variable?

    - by user141146
    Hi, I'm using Ruby 1.9 and I'm wondering if there's a simple regex way to do this. I have many strings that look like some variation of this: str = "Allocation: Random, Control: Active Control, Endpoint Classification: Safety Study, Intervention Model: Parallel Assignment, Masking: Double Blind (Subject, Caregiver, Investigator, Outcomes Assessor), Primary Purpose: Treatment" The idea is that I'd like to break this string into its functional components Allocation: Random Control: Active Control Endpoint Classification: Safety Study Intervention Model: Parallel Assignment Masking: Double Blind (Subject, Caregiver, Investigator, Outcomes, Assessor) Primary Purpose: Treatment The "syntax" of the string is that there is a "key" which consists of one or more "words or other characters" (e.g. Intervention Model) followed by a colon (:). Each key has a corresponding "value" (e.g., Parallel Assignment) that immediately follows the colon (:)…The "value" consists of words, commas (whatever), but the end of the "value" is signaled by a comma. The # of key/value pairs is variable. I'm also assuming that colons (:) aren't allowed to be part of the "value" and that commas (,) aren't allowed to be part of the "key". One would think that there is a "regexy" way to break this into its component pieces, but my attempt at making an appropriate matching regex only picks up the first key/value pair and I'm not sure how to capture the others. Any thoughts on how to capture the other matches? regex = /(([^,]+?): ([^:]+?,))+?/ => /(([^,]+?): ([^:]+?,))+?/ irb(main):139:0> str = "Allocation: Random, Control: Active Control, Endpoint Classification: Safety Study, Intervention Model: Parallel Assignment, Masking: Double Blind (Subject, Caregiver, Investigator, Outcomes Assessor), Primary Purpose: Treatment" => "Allocation: Random, Control: Active Control, Endpoint Classification: Safety Study, Intervention Model: Parallel Assignment, Masking: Double Blind (Subject, Caregiver, Investigator, Outcomes Assessor), Primary Purpose: Treatment" irb(main):140:0> str.match regex => #<MatchData "Allocation: Random," 1:"Allocation: Random," 2:"Allocation" 3:" Random,"> irb(main):141:0> $1 => "Allocation: Random," irb(main):142:0> $2 => "Allocation" irb(main):143:0> $3 => " Random," irb(main):144:0> $4 => nil

    Read the article

  • Getting Memory allocation problem at UIBarButtonItem in Iphone sdk.

    - by monish
    Hi guys, Here I am getting memory allocation problem at UIBarButtonItem and the related code for that is: toolbar = [UIToolbar new]; toolbar.barStyle = UIBarStyleBlackOpaque; [toolbar setFrame:CGRectMake(0, 350,320,20)]; [self.view addSubview:toolbar]; UIBarButtonItem* barItem1 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:@selector(categoryConfig:)] ; rightBarItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(dialogOtherAction:)] ; UIBarButtonItem* barItem2 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:@selector(categoryConfig:)] ; NSArray *items = [NSArray arrayWithObjects: barItem1,rightBarItem,barItem2, nil]; [barItem1 release]; [barItem2 release]; [rightBarItem release]; [toolbar setItems:items animated:NO]; after adding UIBarButtonItems into the array items I released them.even though its showing allocations at barbuttons. can any help me for this? Thank you, Monish.

    Read the article

  • How much is too much memory allocation in NDK?

    - by Maximus
    The NDK download page notes that, "Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on." I came from a C background and was excited to try to use the NDK to operate most of my OpenGL ES functions and any native functions related to physics, animation of vertices, etc... I'm finding that I'm relying quite a bit on Native code and wondering if I may be making some mistakes. I've had no trouble with testing at this point, but I'm curious if I may run into problems in the future. For example, I have game struct defined (somewhat like is seen in the San-Angeles example). I'm loading vertex information for objects dynamically (just what is needed for an active game area) so there's quite a bit of memory allocation happening for vertices, normals, texture coordinates, indices and texture graphic data... just to name the essentials. I'm quite careful about freeing what is allocated between game areas. Would I be safer setting some caps on array sizes or should I charge bravely forward as I'm going now?

    Read the article

  • float** allocation limit + serialized struct problem. Need advice!

    - by jmgunn
    basically im getting an allocation limit error/warning when i create a float** array. the function i am calling to fill the float** retrieves data from a struct loaded from a file. The function works fine when i use one object but when i load 2 objects into memory i get the limit error. I am pretty sure this is to do with byte alignment or a similar thing because my struct is saved with a float** member which i am sure you are not susposed to do !?! Please confirm this! The next question i have now is how to save/serialize the float** member of this struct? I cant really afford to put an upper bound on the array ie "float [10000][3]" because i need/want to use this structure as a base for many other types of objects that may have well under the upper bound. Stroking my chin here! Any help/advice will recieve my highest gratitude. BTW these said struct objects will be used in a game/graphics package, the float** is a float[3] array for storing vertices in a model. Much thanks in advance

    Read the article

  • How to set minimum SQL Server resource allocation for a database?

    - by Jeff Widmer
    Over the past Christmas holiday week, when the website I work on was experiencing very low traffic, we saw several Request timed out exceptions (one on each day 12/26, 12/28, 12/29, and 12/30) on several pages that require user authentication. We rarely saw Request timed out exceptions prior to this very low traffic week. We believe the timeouts were due to the database that it uses being "spun down" on the SQL Server and taking longer to spin up when a request came in. There are 2 databases on the SQL Server (SQL Server 2005), one which is specifically for this application and the other for the public facing website and for authentication; so in the case where users were not logged into the application (which definitely could have been for several hours at a time over Christmas week) the application database probably received no requests. We think at this point SQL Server reallocated resources to the other database and then when a request came in, extra time was needed to spin up the application database and the timeout occurred. Is there a way to tell SQL Server to give a minimum amount of resources to a database at all times?

    Read the article

  • How to test KVM guest CPU maximum allocation limit?

    - by Ace
    Running Ubuntu 13.04 Host and vm Guest. Using virtio for hdd, nic. Max-allocaion CPU cores is 6, minimum is 2. Ive made a vm with virt-manager just to play with, and to test out kvm. Alright, I have a decent understand how the memory balloon driver works, but I still dont know how to test if the guest OS can utilize the max setting for cpu cores. From what i gather, the host will start one thread of qemu for each core allocated per vm. When i run htop inside the guest, it only shows two cores. (also here is the output of cat /proc/cpuinfo: https://gist.github.com/anonymous/93a361545130923537da ) How can I "force" the guest to allocate the other 4 cores so that it can show 6 cores in htop? Is there a way to do this?

    Read the article

  • Where is my object allocation and memory leak in this iPhone/objective C code?

    - by Spottswoode
    Hello, I'm still a rookie when it comes to this programming gig and was wondering if someone could help me smooth out this code. Functionally, the code works great and does what I need it to do. But when I run the performance tool the allocation graph peaks, the CPU load is high, there's a leak(s), and I've also confirmed when running on my iPhone it seems noticeably slower then the rest of the components in my app. I'd appreciate any advice/tips/help anyone could give me. :) Thanks in advance! .h file // // Time_CalculatorViewController.h // Time Calculator // // Created by Adam Soloway on 2/19/10. // Copyright Legacy Pilots 2010. All rights reserved. // #import <UIKit/UIKit.h> @interface Time_CalculatorViewController : UIViewController { //BOOL moveViewUp; //CGFloat scrollAmount; IBOutlet UILabel *hoursLabel; IBOutlet UILabel *minutesLabel; IBOutlet UILabel *hoursDecimalLabel; IBOutlet UILabel *minutesDecimalLabel; IBOutlet UILabel *errorLabel; IBOutlet UITextField *minTextField1; IBOutlet UITextField *minTextField2; IBOutlet UITextField *minTextField3; IBOutlet UITextField *minTextField4; IBOutlet UITextField *minTextField5; IBOutlet UITextField *minTextField6; IBOutlet UITextField *minTextField7; IBOutlet UITextField *minTextField8; IBOutlet UITextField *minTextField9; IBOutlet UITextField *minTextField10; IBOutlet UITextField *hourTextField1; IBOutlet UITextField *hourTextField2; IBOutlet UITextField *hourTextField3; IBOutlet UITextField *hourTextField4; IBOutlet UITextField *hourTextField5; IBOutlet UITextField *hourTextField6; IBOutlet UITextField *hourTextField7; IBOutlet UITextField *hourTextField8; IBOutlet UITextField *hourTextField9; IBOutlet UITextField *hourTextField10; IBOutlet UIButton *resetAll; NSString *minutesString1; NSString *minutesString2; NSString *minutesString3; NSString *minutesString4; NSString *minutesString5; NSString *minutesString6; NSString *minutesString7; NSString *minutesString8; NSString *minutesString9; NSString *minutesString10; NSString *hoursString1; NSString *hoursString2; NSString *hoursString3; NSString *hoursString4; NSString *hoursString5; NSString *hoursString6; NSString *hoursString7; NSString *hoursString8; NSString *hoursString9; NSString *hoursString10; int hourDecimalNumber; int totalTime; int leftOverMinutes; int minuteNumber1; int minuteNumber2; int minuteNumber3; int minuteNumber4; int minuteNumber5; int minuteNumber6; int minuteNumber7; int minuteNumber8; int minuteNumber9; int minuteNumber10; int hourNumber1; int hourNumber2; int hourNumber3; int hourNumber4; int hourNumber5; int hourNumber6; int hourNumber7; int hourNumber8; int hourNumber9; int hourNumber10; } //- (void)scrollTheView:(BOOL)movedUp; - (void)calculateTime; - (IBAction)resetAllValues; @end .m file // // Time_CalculatorViewController.m // Time Calculator // // Created by Adam Soloway on 2/19/10. // Copyright Legacy Pilots 2010. All rights reserved. // #import "Time_CalculatorViewController.h" @implementation Time_CalculatorViewController - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if( minTextField1.editing || minTextField2.editing || minTextField3.editing || minTextField4.editing || minTextField5.editing || minTextField6.editing || minTextField7.editing || minTextField8.editing || minTextField9.editing || minTextField10.editing || hourTextField1.editing || hourTextField2.editing || hourTextField3.editing || hourTextField4.editing || hourTextField5.editing || hourTextField6.editing || hourTextField7.editing || hourTextField8.editing || hourTextField9.editing || hourTextField10.editing) { [minTextField1 resignFirstResponder]; [minTextField2 resignFirstResponder]; [minTextField3 resignFirstResponder]; [minTextField4 resignFirstResponder]; [minTextField5 resignFirstResponder]; [minTextField6 resignFirstResponder]; [minTextField7 resignFirstResponder]; [minTextField8 resignFirstResponder]; [minTextField9 resignFirstResponder]; [minTextField10 resignFirstResponder]; [hourTextField1 resignFirstResponder]; [hourTextField2 resignFirstResponder]; [hourTextField3 resignFirstResponder]; [hourTextField4 resignFirstResponder]; [hourTextField5 resignFirstResponder]; [hourTextField6 resignFirstResponder]; [hourTextField7 resignFirstResponder]; [hourTextField8 resignFirstResponder]; [hourTextField9 resignFirstResponder]; [hourTextField10 resignFirstResponder]; [self calculateTime]; //if (moveViewUp) [self scrollTheView:NO]; } [super touchesBegan:touches withEvent:event]; } /* // The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } */ /* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [minutesString1 release]; [minutesString2 release]; [minutesString3 release]; [minutesString4 release]; [minutesString5 release]; [minutesString6 release]; [minutesString7 release]; [minutesString8 release]; [minutesString9 release]; [minutesString10 release]; [hoursString1 release]; [hoursString2 release]; [hoursString3 release]; [hoursString4 release]; [hoursString5 release]; [hoursString6 release]; [hoursString7 release]; [hoursString8 release]; [hoursString9 release]; [hoursString10 release]; [super dealloc]; } -(BOOL)textFieldShouldReturn:(UITextField *)theTextField { //[minTextField10 resignFirstResponder]; //if (moveViewUp) [self scrollTheView:NO]; [self calculateTime]; return YES; } - (IBAction)resetAllValues { minTextField1.text = 0; minTextField2.text = 0; minTextField3.text = 0; minTextField4.text = 0; minTextField5.text = 0; minTextField6.text = 0; minTextField7.text = 0; minTextField8.text = 0; minTextField9.text = 0; minTextField10.text = 0; hourTextField1.text = 0; hourTextField2.text = 0; hourTextField3.text = 0; hourTextField4.text = 0; hourTextField5.text = 0; hourTextField6.text = 0; hourTextField7.text = 0; hourTextField8.text = 0; hourTextField9.text = 0; hourTextField10.text = 0; totalTime = 0; leftOverMinutes = 0; hoursLabel.text = [NSString stringWithFormat:@"0"]; hourDecimalNumber = 0; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; minutesDecimalLabel.text = [NSString stringWithFormat:@"0"]; self.calculateTime; } - (void)calculateTime { minutesString1 = minTextField1.text; minutesString2 = minTextField2.text; minutesString3 = minTextField3.text; minutesString4 = minTextField4.text; minutesString5 = minTextField5.text; minutesString6 = minTextField6.text; minutesString7 = minTextField7.text; minutesString8 = minTextField8.text; minutesString9 = minTextField9.text; minutesString10 = minTextField10.text; hoursString1 = hourTextField1.text; hoursString2 = hourTextField2.text; hoursString3 = hourTextField3.text; hoursString4 = hourTextField4.text; hoursString5 = hourTextField5.text; hoursString6 = hourTextField6.text; hoursString7 = hourTextField7.text; hoursString8 = hourTextField8.text; hoursString9 = hourTextField9.text; hoursString10 = hourTextField10.text; minuteNumber1 = [minutesString1 intValue]; minuteNumber2 = [minutesString2 intValue]; minuteNumber3 = [minutesString3 intValue]; minuteNumber4 = [minutesString4 intValue]; minuteNumber5 = [minutesString5 intValue]; minuteNumber6 = [minutesString6 intValue]; minuteNumber7 = [minutesString7 intValue]; minuteNumber8 = [minutesString8 intValue]; minuteNumber9 = [minutesString9 intValue]; minuteNumber10 = [minutesString10 intValue]; hourNumber1 = ([hoursString1 intValue] * 60); hourNumber2 = ([hoursString2 intValue] * 60); hourNumber3 = ([hoursString3 intValue] * 60); hourNumber4 = ([hoursString4 intValue] * 60); hourNumber5 = ([hoursString5 intValue] * 60); hourNumber6 = ([hoursString6 intValue] * 60); hourNumber7 = ([hoursString7 intValue] * 60); hourNumber8 = ([hoursString8 intValue] * 60); hourNumber9 = ([hoursString9 intValue] * 60); hourNumber10 = ([hoursString10 intValue] * 60); totalTime = (hourNumber1 + hourNumber2 +hourNumber3 +hourNumber4 +hourNumber5 +hourNumber6 +hourNumber7 +hourNumber8 +hourNumber9 +hourNumber10 + minuteNumber1 + minuteNumber2 + minuteNumber3 + minuteNumber4 + minuteNumber5 +minuteNumber6 + minuteNumber7 + minuteNumber8 + minuteNumber9 + minuteNumber10); if (totalTime <= 59) { leftOverMinutes = totalTime; hoursLabel.text = [NSString stringWithFormat:@"0"]; hourDecimalNumber = 0; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >59 && totalTime <= 119){ leftOverMinutes = totalTime - 60; hoursLabel.text = [NSString stringWithFormat:@"1"]; hourDecimalNumber = 1; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >119 && totalTime <= 179){ leftOverMinutes = totalTime - 120; hoursLabel.text = [NSString stringWithFormat:@"2"]; hourDecimalNumber = 2; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >179 && totalTime <= 239){ leftOverMinutes = totalTime - 180; hoursLabel.text = [NSString stringWithFormat:@"3"]; hourDecimalNumber = 3; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >239 && totalTime <= 299){ leftOverMinutes = totalTime - 240; hoursLabel.text = [NSString stringWithFormat:@"4"]; hourDecimalNumber = 4; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >299 && totalTime <= 359){ leftOverMinutes = totalTime - 300; hoursLabel.text = [NSString stringWithFormat:@"5"]; hourDecimalNumber = 5; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >359 && totalTime <= 419){ leftOverMinutes = totalTime - 360; hoursLabel.text = [NSString stringWithFormat:@"6"]; hourDecimalNumber = 6; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >419 && totalTime <= 479){ leftOverMinutes = totalTime - 420; hoursLabel.text = [NSString stringWithFormat:@"7"]; hourDecimalNumber = 7; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >479 && totalTime <= 539){ leftOverMinutes = totalTime - 480; hoursLabel.text = [NSString stringWithFormat:@"8"]; hourDecimalNumber = 8; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >539 && totalTime <= 599){ leftOverMinutes = totalTime - 540; hoursLabel.text = [NSString stringWithFormat:@"9"]; hourDecimalNumber = 9; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >599 && totalTime <= 659){ leftOverMinutes = totalTime - 600; hoursLabel.text = [NSString stringWithFormat:@"10"]; hourDecimalNumber = 10; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >659 && totalTime <= 719){ leftOverMinutes = totalTime - 660; hoursLabel.text = [NSString stringWithFormat:@"11"]; hourDecimalNumber = 11; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >719 && totalTime <= 779){ leftOverMinutes = totalTime - 720; hoursLabel.text = [NSString stringWithFormat:@"12"]; hourDecimalNumber = 12; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >779 && totalTime <= 839){ leftOverMinutes = totalTime - 780; hoursLabel.text = [NSString stringWithFormat:@"13"]; hourDecimalNumber = 13; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >839 && totalTime <= 899){ leftOverMinutes = totalTime - 840; hoursLabel.text = [NSString stringWithFormat:@"14"]; hourDecimalNumber = 14; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >899 && totalTime <= 959){ leftOverMinutes = totalTime - 900; hoursLabel.text = [NSString stringWithFormat:@"15"]; hourDecimalNumber = 15; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >959 && totalTime <= 1019){ leftOverMinutes = totalTime - 960; hoursLabel.text = [NSString stringWithFormat:@"16"]; hourDecimalNumber = 16; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1019 && totalTime <= 1079){ leftOverMinutes = totalTime - 1020; hoursLabel.text = [NSString stringWithFormat:@"17"]; hourDecimalNumber = 17; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1079 && totalTime <= 1139){ leftOverMinutes = totalTime - 1080; hoursLabel.text = [NSString stringWithFormat:@"18"]; hourDecimalNumber = 18; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1139 && totalTime <= 1199){ leftOverMinutes = totalTime - 1140; hoursLabel.text = [NSString stringWithFormat:@"19"]; hourDecimalNumber = 19; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1199 && totalTime <= 1259){ leftOverMinutes = totalTime - 1200; hoursLabel.text = [NSString stringWithFormat:@"20"]; hourDecimalNumber = 20; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1259 && totalTime <= 1319){ leftOverMinutes = totalTime - 1260; hoursLabel.text = [NSString stringWithFormat:@"21"]; hourDecimalNumber = 21; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1319 && totalTime <= 1379){ leftOverMinutes = totalTime - 1320; hoursLabel.text = [NSString stringWithFormat:@"22"]; hourDecimalNumber = 22; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1379 && totalTime <= 1439){ leftOverMinutes = totalTime - 1380; hoursLabel.text = [NSString stringWithFormat:@"23"]; hourDecimalNumber = 23; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1439 && totalTime <= 1499){ leftOverMinutes = totalTime - 1440; hoursLabel.text = [NSString stringWithFormat:@"24"]; hourDecimalNumber = 24; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1499 && totalTime <= 1559){ leftOverMinutes = totalTime - 1500; hoursLabel.text = [NSString stringWithFormat:@"25"]; hourDecimalNumber = 25; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1559 && totalTime <= 1619){ leftOverMinutes = totalTime - 1560; hoursLabel.text = [NSString stringWithFormat:@"26"]; hourDecimalNumber = 26; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1619 && totalTime <= 1679){ leftOverMinutes = totalTime - 1620; hoursLabel.text = [NSString stringWithFormat:@"27"]; hourDecimalNumber = 27; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1679 && totalTime <= 1739){ leftOverMinutes = totalTime - 1680; hoursLabel.text = [NSString stringWithFormat:@"28"]; hourDecimalNumber = 28; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1739 && totalTime <= 1799){ leftOverMinutes = totalTime - 1740; hoursLabel.text = [NSString stringWithFormat:@"29"]; hourDecimalNumber = 29; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1799 && totalTime <= 1859){ leftOverMinutes = totalTime - 1800; hoursLabel.text = [NSString stringWithFormat:@"30"]; hourDecimalNumber = 30; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1859){ hoursLabel.text = [NSString stringWithFormat:@"Error"]; hoursDecimalLabel.text = [NSString stringWithFormat:@"Error"]; errorLabel.hidden = FALSE; } //Minutes Label if (leftOverMinutes < 10) { minutesLabel.text = [NSString stringWithFormat:@"0%d", leftOverMinutes]; } else minutesLabel.text = [NSString stringWithFormat:@"%d", leftOverMinutes]; //Minutes Decimal Label if (leftOverMinutes >=0 && leftOverMinutes <=2) { minutesDecimalLabel.text = [NSString stringWithFormat:@"0"]; } else if (leftOverMinutes >=3 && leftOverMinutes <=8){ minutesDecimalLabel.text = [NSString stringWithFormat:@"1"]; } else if (leftOverMinutes >=9 && leftOverMinutes <=14){ minutesDecimalLabel.text = [NSString stringWithFormat:@"2"]; } else if (leftOverMinutes >=15 && leftOverMinutes <=20){ minutesDecimalLabel.text = [NSString stringWithFormat:@"3"]; } else if (leftOverMinutes >=21 && leftOverMinutes <=26){ minutesDecimalLabel.text = [NSString stringWithFormat:@"4"]; } else if (leftOverMinutes >=27 && leftOverMinutes <=32){ minutesDecimalLabel.text = [NSString stringWithFormat:@"5"]; } else if (leftOverMinutes >=33 && leftOverMinutes <=38){ minutesDecimalLabel.text = [NSString stringWithFormat:@"6"]; } else if (leftOverMinutes >=39 && leftOverMinutes <=44){ minutesDecimalLabel.text = [NSString stringWithFormat:@"7"]; } else if (leftOverMinutes >=45 && leftOverMinutes <=50){ minutesDecimalLabel.text = [NSString stringWithFormat:@"8"]; } else if (leftOverMinutes >=51 && leftOverMinutes <=56){ minutesDecimalLabel.text = [NSString stringWithFormat:@"9"]; } else if (leftOverMinutes >=57 && leftOverMinutes <=60){ minutesDecimalLabel.text = [NSString stringWithFormat:@"0"]; hourDecimalNumber = hourDecimalNumber + 1; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; } } @end

    Read the article

  • SQL SERVER – Beginning of SQL Server Architecture – Terminology – Guest Post

    - by pinaldave
    SQL Server Architecture is a very deep subject. Covering it in a single post is an almost impossible task. However, this subject is very popular topic among beginners and advanced users.  I have requested my friend Anil Kumar who is expert in SQL Domain to help me write  a simple post about Beginning SQL Server Architecture. As stated earlier this subject is very deep subject and in this first article series he has covered basic terminologies. In future article he will explore the subject further down. Anil Kumar Yadav is Trainer, SQL Domain, Koenig Solutions. Koenig is a premier IT training firm that provides several IT certifications, such as Oracle 11g, Server+, RHCA, SQL Server Training, Prince2 Foundation etc. In this Article we will discuss about MS SQL Server architecture. The major components of SQL Server are: Relational Engine Storage Engine SQL OS Now we will discuss and understand each one of them. 1) Relational Engine: Also called as the query processor, Relational Engine includes the components of SQL Server that determine what your query exactly needs to do and the best way to do it. It manages the execution of queries as it requests data from the storage engine and processes the results returned. Different Tasks of Relational Engine: Query Processing Memory Management Thread and Task Management Buffer Management Distributed Query Processing 2) Storage Engine: Storage Engine is responsible for storage and retrieval of the data on to the storage system (Disk, SAN etc.). to understand more, let’s focus on the following diagram. When we talk about any database in SQL server, there are 2 types of files that are created at the disk level – Data file and Log file. Data file physically stores the data in data pages. Log files that are also known as write ahead logs, are used for storing transactions performed on the database. Let’s understand data file and log file in more details: Data File: Data File stores data in the form of Data Page (8KB) and these data pages are logically organized in extents. Extents: Extents are logical units in the database. They are a combination of 8 data pages i.e. 64 KB forms an extent. Extents can be of two types, Mixed and Uniform. Mixed extents hold different types of pages like index, System, Object data etc. On the other hand, Uniform extents are dedicated to only one type. Pages: As we should know what type of data pages can be stored in SQL Server, below mentioned are some of them: Data Page: It holds the data entered by the user but not the data which is of type text, ntext, nvarchar(max), varchar(max), varbinary(max), image and xml data. Index: It stores the index entries. Text/Image: It stores LOB ( Large Object data) like text, ntext, varchar(max), nvarchar(max),  varbinary(max), image and xml data. GAM & SGAM (Global Allocation Map & Shared Global Allocation Map): They are used for saving information related to the allocation of extents. PFS (Page Free Space): Information related to page allocation and unused space available on pages. IAM (Index Allocation Map): Information pertaining to extents that are used by a table or index per allocation unit. BCM (Bulk Changed Map): Keeps information about the extents changed in a Bulk Operation. DCM (Differential Change Map): This is the information of extents that have modified since the last BACKUP DATABASE statement as per allocation unit. Log File: It also known as write ahead log. It stores modification to the database (DML and DDL). Sufficient information is logged to be able to: Roll back transactions if requested Recover the database in case of failure Write Ahead Logging is used to create log entries Transaction logs are written in chronological order in a circular way Truncation policy for logs is based on the recovery model SQL OS: This lies between the host machine (Windows OS) and SQL Server. All the activities performed on database engine are taken care of by SQL OS. It is a highly configurable operating system with powerful API (application programming interface), enabling automatic locality and advanced parallelism. SQL OS provides various operating system services, such as memory management deals with buffer pool, log buffer and deadlock detection using the blocking and locking structure. Other services include exception handling, hosting for external components like Common Language Runtime, CLR etc. I guess this brief article gives you an idea about the various terminologies used related to SQL Server Architecture. In future articles we will explore them further. Guest Author  The author of the article is Anil Kumar Yadav is Trainer, SQL Domain, Koenig Solutions. Koenig is a premier IT training firm that provides several IT certifications, such as Oracle 11g, Server+, RHCA, SQL Server Training, Prince2 Foundation etc. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, SQL Training, T SQL, Technology

    Read the article

  • Memory allocation in detached NSThread to load an NSDictionary in background?

    - by mobibob
    I am trying to launch a background thread to retrieve XML data from a web service. I developed it synchronously - without threads, so I know that part works. Now I am ready to have a non-blocking service by spawning a thread to wait for the response and parse. I created an NSAutoreleasePool inside the thread and release it at the end of the parsing. The code to spawn and the thread are as follows: Spawn from main-loop code: . . [NSThread detachNewThreadSelector:@selector(spawnRequestThread:) toTarget:self withObject:url]; . . Thread (inside 'self'): -(void) spawnRequestThread: (NSURL*) url { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; parser = [[NSXMLParser alloc] initWithContentsOfURL:url]; [self parseContentsOfResponse]; [parser release]; [pool release]; } The method parseContentsOfResponse fills an NSMutableDictionary with the parsed document contents. I would like to avoid moving the data around a lot and allocate it back in the main-loop that spawned the thread rather than making a copy. First, is that possible, and if not, can I simply pass in an allocated pointer from the main thread and allocate with 'dictionaryWithDictionary' method? That just seems so inefficient. Are there perferred designs?

    Read the article

  • Time/resource allocation on a Stylish vs. Functional user interface

    - by jasonk
    When developing applications how much focus/time do you place on an application’s style vs. functionality. Battleship gray apps drive me insane. On the other hand maximizing a business application’s "style" can tax time and financial resources. Applications need to be appealing to resell or meet basic customer expectations, but defining a healthy medium can be difficult. What would you say are reasonable "standards" for allocating develop time/resources should be dedicated to stylizing a business application?

    Read the article

  • Question about memory allocation when initializing char arrays in C/C++.

    - by Carlos Nunez
    Before anything, I apologize if this question has been asked before. I am programming a simple packet sniffer for a class project. For a little while, I ran into the issue where the source and destination of a packet appeared to be the same. For example, the source and destination of an Ethernet frame would be the same MAC address all of the time. I custom-made ether_ntoa(char *) because Windows does not seem to have ethernet.h like Linux does. Code snippet is below: char *ether_ntoa(u_char etheraddr[ETHER_ADDR_LEN]) { int i, j; char eout[32]; for(i = 0, j = 0; i < 5; i++) { eout[j++] = etheraddr[i] >> 4; eout[j++] = etheraddr[i] & 0xF; eout[j++] = ':'; } eout[j++] = etheraddr[i] >> 4; eout[j++] = etheraddr[i] & 0xF; eout[j++] = '\0'; for(i = 0; i < 17; i++) { if(eout[i] < 10) eout[i] += 0x30; else if(eout[i] < 16) eout[i] += 0x57; } return(eout); } I solved the problem by using malloc() to have the compiler assign memory (i.e. instead of char eout[32], I used char * eout; eout = (char *) malloc (32);). However, I thought that the compiler assigned different memory locations when one sized a char-array at compile time. Is this incorrect? Thanks! Carlos Nunez

    Read the article

  • External hard drive FAT32 to NTFS conversion fails

    - by Pieter
    I'm trying to convert the FAT32 file system of an external hard drive to NTFS. Here's what happened: C:\Windows\system32>chkdsk G: The type of the file system is FAT32. Volume PIETEREXT created 3/19/2008 12:43 Volume Serial Number is 1806-2E30 Windows is verifying files and folders... File and folder verification is complete. Windows has scanned the file system and found no problems. No further action is required. 488,264,768 KB total disk space. 72,192 KB in 1,503 hidden files. 1,281,792 KB in 40,029 folders. 309,235,168 KB in 199,915 files. 177,675,584 KB are available. 32,768 bytes in each allocation unit. 15,258,274 total allocation units on disk. 5,552,362 allocation units available on disk. C:\Windows\system32>cd \ C:\>convert g: /fs:ntfs The type of the file system is FAT32. Enter current volume label for drive G: PIETEREXT Volume PIETEREXT created 3/19/2008 12:43 Volume Serial Number is 1806-2E30 Windows is verifying files and folders... File and folder verification is complete. Windows has scanned the file system and found no problems. No further action is required. 488,264,768 KB total disk space. 72,192 KB in 1,503 hidden files. 1,281,792 KB in 40,029 folders. 309,235,168 KB in 199,915 files. 177,675,584 KB are available. 32,768 bytes in each allocation unit. 15,258,274 total allocation units on disk. 5,552,362 allocation units available on disk. Determining disk space required for file system conversion... Total disk space: 488384001 KB Free space on volume: 177675584 KB Space required for conversion: 975155 KB Converting file system The conversion failed. G: was not converted to NTFS I looked at the TechNet page for my error, but after closing every app the conversion was still failing halfway through. Why does it keep failing? I kept an eye on Task Manager but it didn't look like my system resources were near depletion. I'm using Windows 8.

    Read the article

  • What’s Your Tax Strategy? Automate the Tax Transfer Pricing Process!

    - by tobyehatch
    Does your business operate in multiple countries? Well, whether you like it or not, many local and international tax authorities inspect your tax strategy.  Legal, effective tax planning is perceived as a “moral” issue. CEOs are being asked to testify on their process of tax transfer pricing between multinational legal entities.  Marc Seewald, Senior Director of Product Management for EPM Applications specializing in all tax subjects and Product Manager for Oracle Hyperion Tax Provisioning, and Bart Stoehr, Senior Director of Product Strategy for Oracle Hyperion Profitability and Cost Management joined me for a discussion/podcast on this interesting subject.  So what exactly is “tax transfer pricing”? Marc defined it this way. “Tax transfer pricing is a profit allocation methodology required to be used by multinational corporations. Specifically, the ultimate goal of the transfer pricing is to ensure that the global multinational pays their fair share of income tax in each of their local markets. Specifically, it prevents companies from unfairly moving profit from ‘high tax’ countries to ‘low tax’ countries.” According to Marc, in today’s global economy, profitability can be significantly impacted by goods and services exchanged between the related divisions within a single multinational company.  To ensure that these cost allocations are done fairly, there are rules that govern the process. These rules ensure that intercompany allocations fairly represent the actual nature of the businesses activity- as if two divisions were unrelated - and provide a clear audit trail of how the costs have been allocated to prove that allocations fall within reasonable ranges.  What are the repercussions of improper tax transfer pricing? How important is it? Tax transfer pricing allocations can materially impact the amount of overall corporate income taxes paid by a company worldwide, in some cases by hundreds of millions of dollars!  Since so much tax revenue is at stake, revenue agencies like the IRS, and international regulatory bodies like the Organization for Economic Cooperation and Development (OECD) are pushing to reform and clarify reporting for tax transfer pricing. Most recently the OECD announced an “Action Plan for Base Erosion and Profit Shifting”. As Marc explained, the times are changing and companies need to be responsive to this issue. “It feels like every other week there is another company being accused of avoiding taxes,” said Marc. Most recently, Caterpillar was accused of avoiding billions of dollars in taxes. In the last couple of years, Apple, GE, Ikea, and Starbucks, have all been accused of tax avoidance. It’s imperative that companies like these have a clear and auditable tax transfer process that enables them to justify tax transfer pricing allocations and avoid steep penalties and bad publicity. Transparency and efficiency are what is needed when it comes to the tax transfer pricing process. Bart explained that tax transfer pricing is driving a deeper inspection of profit recognition specifically focused on the tax element of profit.  However, allocations needed to support tax profitability are nearly identical in process to allocations taking place in other parts of the finance organization. For example, the methods and processes necessary to arrive at tax profitability by legal entity are no different than those used to arrive at fully loaded profitability for a product line. In fact, there is a great opportunity for alignment across these two different functions.So it seems that tax transfer pricing should be reflected in profitability in general. Bart agreed and told us more about some of the critical sub-processes of an overall tax transfer pricing process within the Oracle solution for tax transfer pricing.  “First, there is a ton of data preparation, enrichment and pre-allocation data analysis that is managed in the Oracle Hyperion solution. This serves as the “data staging” to the next, critical sub-processes.  From here, we leverage the Oracle EPM platform’s ability to re-use dimensions and legal entity driver data and financial data with Oracle Hyperion Profitability and Cost Management (HPCM).  Within HPCM, we manage the driver data, define the legal entity to legal entity allocation rules (like cost plus), and have the option to test out multiple, simultaneous tax transfer pricing what-if scenarios.  Once processed, a tax expert can evaluate the effectiveness of any one scenario result versus another via a variance analysis configured with HPCM’s pre-packaged reporting capability known as Oracle Hyperion SmartView for Office.”   Further, Bart explained that the ability to visibly demonstrate how a cost or revenue has been allocated is really helpful and auditable.  “HPCM’s Traceability Maps are that visual representation of all allocation flows that have been executed and is the tax transfer analyst’s best friend in maintaining clear documentation for tax transfer pricing audits. Simply click and drill as you inspect the chain of allocation definitions and results. Once final, the post-allocated tax data can be compared to the GL to create invoices and journal entries for posting to your GL system of choice.  Of course, there is a framework for overall governance of the journal entries, allocation percentages, and reporting to include necessary approvals.” Lastly, Marc explained that the key value in using the Oracle Hyperion solution for tax transfer pricing is that it keeps everything in alignment in one single place. Specifically, Oracle Hyperion effectively becomes the single book of record for the GAAP, management, and the tax set of books. There are many benefits to having one source of the truth. These include EFFICIENCY, CONTROLS and TRANSPARENCY.So, what’s your tax strategy? Why not automate the tax transfer pricing process!To listen to the entire podcast, click here.To learn more about Oracle Hyperion Profitability and Cost Management (HPCM), click here.

    Read the article

  • Highly efficient filesystem APIs for certain kinds of operations

    - by romkyns
    I occasionally find myself needing certain filesystem APIs which could be implemented very efficiently if supported by the filesystem, but I've never heard of them. For example: Truncate file from the beginning, on an allocation unit boundary Split file into two on an allocation unit boundary Insert or remove a chunk from the middle of the file, again, on an allocation unit boundary The only way that I know of to do things like these is to rewrite the data into a new file. This has the benefit that the allocation unit is no longer relevant, but is extremely slow in comparison to some low-level filesystem magic. I understand that the alignment requirements mean that the methods aren't always applicable, but I think they can still be useful. For example, a file archiver may be able to trim down the archive very efficiently after the user deletes a file from the archive, even if that leaves a small amount of garbage either side for alignment reasons. Is it really the case that such APIs don't exist, or am I simply not aware of them? I am mostly interested in NTFS, but hearing about other filesystems will be interesting too.

    Read the article

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