Search Results

Search found 13616 results on 545 pages for 'rights management'.

Page 167/545 | < Previous Page | 163 164 165 166 167 168 169 170 171 172 173 174  | Next Page >

  • Should developers *really* have private offices?

    - by Aron Rotteveel
    We will probably be moving within a year, so we have to make some decisions regarding office layout. At the moment, our company is basically one big office. When our developers can't bother to be disturbed at all, we all have our own headphones to mute the outside world. Still, it seems a lot of people feel that private offices are no doubt the way to go. From Joel's article Private Offices Redux: Not every programmer in the world wants to work in a private office. In fact quite a few would tell you unequivocally that they prefer the camaradarie and easy information sharing of an open space. Don't fall for it. They also want M&Ms for breakfast and a pony. Open space is fun but not productive. Even though I can understand the benefit on productivity, does having a private office really result in more net productivity? There seem to be plenty of companies that create wide open spaces and still maintain good productivity. Or so it seems. (I should mention many of them use cubicles, though) What is your opinion on this? What does your company do? Is there some middle ground in this? Some more related information on this matter: Private Offices Redux The new Fog Creek office A Field Guide to Developers Gmail recruitment page. Found this last one somewhat remarkable since the Gmail recruitment page promotes the "wide open space" idea.

    Read the article

  • UIVIewController not released when view is dismissed

    - by Nelson Ko
    I have a main view, mainWindow, which presents a couple of buttons. Both buttons create a new UIViewController (mapViewController), but one will start a game and the other will resume it. Both buttons are linked via StoryBoard to the same View. They are segued to modal views as I'm not using the NavigationController. So in a typical game, if a person starts a game, but then goes back to the main menu, he triggers: [self dismissViewControllerAnimated:YES completion:nil ]; to return to the main menu. I would assume the view controller is released at this point. The user resumes the game with the second button by opening another instance of mapViewController. What is happening, tho, is some touch events will trigger methods on the original instance (and write status updates to them - therefore invisible to the current view). When I put a breakpoint in the mapViewController code, I can see the instance will be one or the other (one of which should be released). I have tried putting a delegate to the mainWindow clearing the view: [self.delegate clearMapView]; where in the mainWindow - (void) clearMapView{ gameWindow = nil; } I have also tried self.view=nil; in the mapViewController. The mapViewController code contains MVC code, where the model is static. I wonder if this may prevent ARC from releasing the view. The model.m contains: static CanShieldModel *sharedInstance; + (CanShieldModel *) sharedModel { @synchronized(self) { if (!sharedInstance) sharedInstance = [[CanShieldModel alloc] init]; return sharedInstance; } return sharedInstance; } Another post which may have a lead, but so far not successful, is UIViewController not being released when popped I have in ViewDidLoad: // checks to see if app goes inactive - saves. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resignActive) name:UIApplicationWillResignActiveNotification object:nil]; with the corresponding in ViewDidUnload: [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillResignActiveNotification object:nil]; Does anyone have any suggestions? EDIT: - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ NSString *identifier = segue.identifier; if ([identifier isEqualToString: @"Start Game"]){ gameWindow = (ViewController *)[segue destinationViewController]; gameWindow.newgame=-1; gameWindow.delegate = self; } else if ([identifier isEqualToString: @"Resume Game"]){ gameWindow = (ViewController *)[segue destinationViewController]; gameWindow.newgame=0; gameWindow.delegate = self;

    Read the article

  • Is it OK to write code after [super dealloc]? (Objective-C)

    - by Richard J. Ross III
    I have a situation in my code, where I cannot clean up my classes objects without first calling [super dealloc]. It is something like this: // Baseclass.m @implmentation Baseclass ... -(void) dealloc { [self _removeAllData]; [aVariableThatBelongsToMe release]; [anotherVariableThatBelongsToMe release]; [super dealloc]; } ... @end This works great. My problem is, when I went to subclass this huge and nasty class (over 2000 lines of gross code), I ran into a problem: when I released my objects before calling [super dealloc] I had zombies running through the code that were activated when I called the [self _removeAllData] method. // Subclass.m @implementation Subclass ... -(void) deallloc { [super dealloc]; [someObjectUsedInTheRemoveAllDataMethod release]; } ... @end This works great, and It didn't require me to refactor any code. My question Is this: Is it safe for me to do this, or should I refactor my code? Or maybe autorelease the objects? I am programming for iPhone if that matters any.

    Read the article

  • Setting synthesized arrays causing memory leaks using nested arrays

    - by webtoad
    Hello: Why is the following code causing a memory leak in an iPhone App? All of the initted objects below leak, including the arrays, the strings and the numbers. So, I'm thinking it has something to do with the the synthesized array property not releasing the object when I set the property again on the second and subsequent time this piece of code is called. Here is the code: "controller" (below) is my custom view controller class, which I have a reference to, and I am setting with this code snippet: sqlite3_stmt *statement; NSMutableArray *foo_IDs = [[NSMutableArray alloc] init]; NSMutableArray *foo_Names = [[NSMutableArray alloc] init]; NSMutableArray *foo_IDsBySection = [[NSMutableArray alloc] init]; NSMutableArray *foo_NamesBySection = [[NSMutableArray alloc] init]; // Get data: NSString *sql = @"select distinct p.foo_ID, p.foo_Name from foo as p "; if (sqlite3_prepare_v2(...) == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { int p_id; NSString *foo_Name; p_id = sqlite3_column_int(statement, 0); char *str2 = (char *)sqlite3_column_text(statement, 1); foo_Name = [NSString stringWithCString:str2]; [foo_IDs addObject:[NSNumber numberWithInt:p_id]]; [foo_Names addObject:foo_Name]; } sqlite3_finalize(statement); } // Pass the array itself into another array: // (normally there is more than one array in each array) [foo_IDsBySection addObject: foo_IDs]; [foo_NamesBySection addObject: foo_Names]; [foo_IDs release]; [foo_Names release]; // Set some synthesized properties (of type NSArray, nonatomic, // retain) in controller: controller.foo_IDsBySection = foo_IDsBySection; controller.foo_NamesBySection = foo_NamesBySection; [foo_IDsBySection release]; [foo_NamesBySection release]; Thanks for any help!

    Read the article

  • Objective-C ref count and autorelease

    - by turbovince
    Hey guys, suppose the following code: int main (int argc, const char * argv[]) { //[...] Rectangle* myRect = [[Rectangle alloc] init]; Vector2* newOrigin = [[[Vector2 alloc] init] autorelease]; // ref count 1 [newOrigin setX: 50.0f]; [myRect setOrigin: newOrigin]; // ref count 2 [myRect.origin setXY: 25.0f :100.0f]; // ref count goes to 3... why ? [myRect release]; [pool drain]; return 0; } Rectangle's origin is declared as a (retain) synthesized property. Just wondering 2 things: Why does ref count goes to 3 when using the getter accessor of Rectangle's origin? Am I doing something wrong ? With a ref count of 3, I don't understand how this snippet of code cannot leak. Calling release on myRect will make it go down to 2 since I call release on the origin in dealloc(). But then, when does autorelease take effect? Thanks!

    Read the article

  • When will YOU adopt C++0x?

    - by HighCommander4
    I'm particularly looking for input from managers of ongoing C++ projects: Have you already adopted C++0x? If so, what has your experience been like? If you haven't adopted C++0x yet, are you planning to? If so, what is your timeline (in rough terms)? Are there any obstacles that are holding you back from adopting C++0x? Perhaps you are waiting for your favourite compiler or IDE to catch up? For managers of open source projects: are you afraid that adopting C++0x will mean less developers who are willing/able to contribute because they don't know the new features? Or, on the other hand, do you think most developers have been eagerly awaiting C++0x, and and will jump at the opportunity to use it? Do you think C++0x is stable enough to be adopted by a large project?

    Read the article

  • P-invoke call fails if too much memory is assigned beforehand

    - by RandomEngy
    I've got a p-invoke call to an unmanaged DLL that was failing in my WPF app but not in a simple, starter WPF app. I tried to figure out what the problem was but eventually came to the conclusion that if I assign too much memory before making the call, the call fails. I had two separate blocks of code, both of which would succeed on their own, but that would cause failure if both were run. (They had nothing to do with what the p-invoke call is trying to do). What kind of issues in the unmanaged library would cause such an issue? I thought that the managed and unmanaged heaps were supposed to be automatically separated. The crash as far as I can tell is happening in a dynamically loaded secondary DLL from the one p-invoked into. Could that have something to do with it?

    Read the article

  • Mercurial cherry picking changes for commit

    - by mansu
    Say, I made many changes to my code and only need to commit a few of those changes. Is there a way to do it in mercurial? I know that darcs has a feature like this one. I know "hg transplant" can do this between branches, but I need something like this for committing code in the present branch and not when adding change sets from some other branch.

    Read the article

  • folder structure for project documentation

    - by Qiulang
    Hi all, I saw some questions raised about the folder structure of source codes, but I never see the question about folder structure of project documentation. I googled it and still do not see many articles talk about. Here is one http://www.projectperfect.com.au/downloads/Info/info_project_folder_structure.pdf To quote some of its words: "There are two broad approaches: Organize by phase so that each top directory is a phase. For example, you might have directories for Feasibility, Business Analysis, Design etc. or whatever your phases are called. Organize by function so that the top directory level are functions. For example, Risks, Requirements, Scope, Change Control, Development. Most times a mix of both are used..." So any thought about it? I believe this is also an important issue!

    Read the article

  • Autorelease vs. Release

    - by Sheehan Alam
    Given the two scenarios, which code is best practice and why? Autorelease loginButton = [[[UIBarButtonItem alloc] initWithTitle:@"Login" style:UIBarButtonItemStylePlain target:self action:@selector(loginButtonClicked:)] autorelease]; self.navigationItem.rightBarButtonItem = loginButton; or Release loginButton = [[UIBarButtonItem alloc] initWithTitle:@"Login" style:UIBarButtonItemStylePlain target:self action:@selector(loginButtonClicked:)]; self.navigationItem.rightBarButtonItem = loginButton; [loginButton release];

    Read the article

  • release viewcontroller after presenting modally

    - by Jonathan
    I was watching CS193P Stanford course on Itunes, and in one of the lectures a demo was given and There it was said you could present the viewcontroller modally and then release it. Roughly like this (I know this isn't perfect but I'm on my PC atm) [self.view presentcontentmodally:myVC] [myVC release]; However this seems to produce problems. If I put a NSLog(@"%d", [myVC retainCount]) between those two lines then it returns 2 implying it is ok to release. However when I dismiss the myVC the app crashes. Nothing in the NSlog and the debugger won't show where it stopped. But I used malloc-history or something that some blog said would help. And found that it was the myVC. So should I be releasing myVC? (also when the modalVC has been dissmissed should the app's memory usuage go back to before the modalVC was presented?)

    Read the article

  • Implications of trying to double free memory space in C

    - by SidNoob
    Here' my piece of code: #include <stdio.h> #include<stdlib.h> struct student{ char *name; }; int main() { struct student s; s.name = malloc(sizeof(char *)); // I hope this is the right way... printf("Name: "); scanf("%[^\n]", s.name); printf("You Entered: \n\n"); printf("%s\n", s.name); free(s.name); // This will cause my code to break } All I know is that dynamic allocation on the 'heap' needs to be freed. My question is, when I run the program, sometimes the code runs successfully. i.e. ./struct Name: Thisis Myname You Entered: Thisis Myname I tried reading this I've concluded that I'm trying to double-free a piece of memory i.e. I'm trying to free a piece of memory that is already free? (hope I'm correct here. If Yes, what could be the Security Implications of a double-free?) While it fails sometimes as its supposed to: ./struct Name: CrazyFishMotorhead Rider You Entered: CrazyFishMotorhead Rider *** glibc detected *** ./struct: free(): invalid next size (fast): 0x08adb008 *** ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(+0x6b161)[0xb7612161] /lib/tls/i686/cmov/libc.so.6(+0x6c9b8)[0xb76139b8] /lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xb7616a9d] ./struct[0x8048533] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xb75bdbd6] ./struct[0x8048441] ======= Memory map: ======== 08048000-08049000 r-xp 00000000 08:01 288098 /root/struct 08049000-0804a000 r--p 00000000 08:01 288098 /root/struct 0804a000-0804b000 rw-p 00001000 08:01 288098 /root/struct 08adb000-08afc000 rw-p 00000000 00:00 0 [heap] b7400000-b7421000 rw-p 00000000 00:00 0 b7421000-b7500000 ---p 00000000 00:00 0 b7575000-b7592000 r-xp 00000000 08:01 788956 /lib/libgcc_s.so.1 b7592000-b7593000 r--p 0001c000 08:01 788956 /lib/libgcc_s.so.1 b7593000-b7594000 rw-p 0001d000 08:01 788956 /lib/libgcc_s.so.1 b75a6000-b75a7000 rw-p 00000000 00:00 0 b75a7000-b76fa000 r-xp 00000000 08:01 920678 /lib/tls/i686/cmov/libc-2.11.1.so b76fa000-b76fc000 r--p 00153000 08:01 920678 /lib/tls/i686/cmov/libc-2.11.1.so b76fc000-b76fd000 rw-p 00155000 08:01 920678 /lib/tls/i686/cmov/libc-2.11.1.so b76fd000-b7700000 rw-p 00000000 00:00 0 b7710000-b7714000 rw-p 00000000 00:00 0 b7714000-b7715000 r-xp 00000000 00:00 0 [vdso] b7715000-b7730000 r-xp 00000000 08:01 788898 /lib/ld-2.11.1.so b7730000-b7731000 r--p 0001a000 08:01 788898 /lib/ld-2.11.1.so b7731000-b7732000 rw-p 0001b000 08:01 788898 /lib/ld-2.11.1.so bffd5000-bfff6000 rw-p 00000000 00:00 0 [stack] Aborted So why is it that my code does work sometimes? i.e. the compiler is not able to detect at times that I'm trying to free an already freed memory. Has it got to do something with my stack/heap size?

    Read the article

  • Will it use more and more memory if I keep drawing on the UIView?

    - by Tattat
    This is my drawRect: CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 2.0); CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor); CGContextMoveToPoint(context, x1, y1); CGContextAddLineToPoint(context, x2, y2); CGContextStrokePath(context); If I run this code thousand times or more. My UIView will have many lines on that. Will it use more memory than only just one line on it? Er... ...I mean, will the program remember the line I draw or after it draw the lines, it won't have any information in the memory. thz .

    Read the article

  • How to keep windows from paging block of memory

    - by photo_tom
    We are working on a Vista/Windows 7 applicaiton that will be running in 64 bit mode using VS2008/C++. We will be needing to cache hundreds of 2-3 mb blobs of data in RAM for performance reasons up to some memory limit. Our usage profile is such that we cannot read the data in fast enough if it is all on the the disk. Cached Memory usage will be larger than 1gb memory used. For this to work well, we need to ensure that Windows does not page this memory out as it will defeat the purpose of why we are doing this. I've done a fair amount of research and cannot find documenation that states exactly how to do this. I've seen several references that infer memory mapped files work this way. Is there an expert who can clarify this for me? I'm aware there are other programs that we could adapt to do this, for example, splitting the blobs and loading into memcache or inmemory databases, but they all have too many problems with performance or code complexity. Suggestions?

    Read the article

  • Allocated Private Bytes keeps going up in one computer but not the other

    - by Jacob
    OK, this may sound weird, but here goes. There are 2 computers, A (Pentium D) and B (Quad Core) with almost the same amount of RAM. If I run the same code on both computers, the allocated private bytes in A never goes down resulting in a crash later on. In B it looks like the private bytes is constantly deallocated and everything looks fine. In both computers, the working set is deallocated and allocated similarly. Could this be an issue with manifests or DLLs (system)? I'm clueless. Note: I observed the utilized memory with Process Explorer.

    Read the article

  • SQL 2008 Select Top 1000 and update the selected database drop-down

    - by CWinKY
    When you right click and do a Select top 1000 rows from a table in sql 2008, it opens a tab and writes the sql and then executes it. This is okay, however I'll erase the sql and use the same tab often to do other sql statements. What annoys me is that I have to go to the database drop-down at the top of the window and change it to the current database I'm in because it says Master. How can I make sql 2008 update the selected database for this tab automatically when I right click a table and do select top 1000? On a side note, can I automatically hide the select statement that it generates and just show grid of results?

    Read the article

  • How should I manage/declare dependencies between open source C# projects?

    - by munificent
    I've got a game (a roguelike to be specific) in C# that I'm in the process of cleaning up to open source. One step I'd like to take is splitting it into three distinct pieces: A simple package of utility classes, things like 2D arrays, vectors, etc. A terminal UI package that gives you a curses-like display. It depends on 1. The actual game, which uses 1 and 2. Right now, these are all separate projects in the same solution, but I'd kind of like to make them completely separate projects (in the "open source project" sense, not the "visual studio project" use of the term) with their own names and repos. I think, at the very least, #1 is generally useful even if you aren't building game, and I don't want someone to have to build an entire game just to get some handy functions. What I'm not sure about is how to handle the dependencies if I split up the solution. If someone decides they want to sync the game, how should I ensure they also get 1 and 2? Include the built dependent .dlls in the games repo? Just document, "you need these other projects and they must be in a path relative to the game like this". Just leave it all one giant solution and a single repo. Something I'm not thinking of?

    Read the article

  • SystemInformation.PowerStatus.BatteryLifeRemaining returns -1?

    - by dsrdakota
    In my code I have: Dim ps as PowerStatus = SystemInformation.PowerStatus Dim batteryTimeLeft as Integer = ps.BatteryLifeRemaining 'I have a problem here MsgBox("Time left on battery: " & cstr(batteryTimeLeft),vbInformation,"Info") PowerStatus.BatteryLifeRemaining always returns -1 when I have a battery present and used or when not used. Why does this always return -1? I currently am using MS .NET 4.0 Client Profile on VB.NET 2010 Express. I unplug the for my laptop and see if it makes a difference and it doesn't. Also tried in plugged in. Help please???

    Read the article

  • WithEvents LinkedList is it Impossible?

    - by serhio
    What is the optimal approach to a WithEvents Collection - VB.NET? Have you any remarks on the code bellow (skipping the Nothing verifications)? The problem is when I obtain the LinkedListNode(Of Foo) in a For Each block I can set myNode.Value = something, and here is a handlers leak... -Could I override the FooCollection's GetEnumerator in this case? -No. :( cause NotInheritable Class LinkedListNode(Of T) Class Foo Public Event SelectedChanged As EventHandler End Class Class FooCollection Inherits LinkedList(Of Foo) Public Event SelectedChanged As EventHandler Protected Overloads Sub AddFirst(ByVal item As Foo) AddHandler item.SelectedChanged, AddressOf OnSelectedChanged MyBase.AddFirst(item) End Sub Protected Overloads Sub AddLast(ByVal item As Foo) AddHandler item.SelectedChanged, AddressOf OnSelectedChanged MyBase.AddLast(item) End Sub ' ------------------- ' Protected Overloads Sub RemoveFirst() RemoveHandler MyBase.First.Value.SelectedChanged, _ AddressOf OnSelectedChanged MyBase.RemoveFirst() End Sub Protected Overloads Sub RemoveLast(ByVal item As Foo) RemoveHandler MyBase.Last.Value.SelectedChanged, _ AddressOf OnSelectedChanged MyBase.RemoveLast() End Sub ' ------------------- ' Protected Sub OnSelectedChanged(ByVal sender As Object, ByVal e As EventArgs) RaiseEvent SelectedChanged(sender, e) End Sub End Class

    Read the article

  • MMGR Questions, code use and thread-saftey

    - by chadb
    1) Is MMGR thread safe? 2) I was hoping someone could help me understand some code. I am looking at something where a macro is used, but I don't understand the macro. I know it contains a function call and an if check, however, the function is a void function. How does wrapping "(m_setOwner (FILE,_LINE_,FUNCTION),false)" ever change return types? #define someMacro (m_setOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new ... void m_setOwner(const char *file, const unsigned int line, const char *func); 3) What is the point of the reservoir? 4) On line 770 ("void *operator new(size_t reportedSize)" there is the line "// ANSI says: allocation requests of 0 bytes will still return a valid value" Who/what is ANSI in this context? Do they mean the standards? 5) This is more of C++ standards, but where does "reportedSize" come from for "void *operator new(size_t reportedSize)"? 6) Is this the code that is actually doing the allocation needed? "au-actualAddress = malloc(au-actualSize);"

    Read the article

  • Question about unions and heap allocated memory

    - by Dennis Miller
    I was trying to use a union to so I could update the fields in one thread and then read allfields in another thread. In the actual system, I have mutexes to make sure everything is safe. The problem is with fieldB, before I had to change it fieldB was declared like field A and C. However, due to a third party driver, fieldB must be alligned with page boundary. When I changed field B to be allocated with valloc, I run into problems. Questions: 1) Is there a way to statically declare fieldB alligned on page boundary. Basically do the same thing as valloc, but on the stack? 2) Is it possible to do a union when field B, or any field is being allocated on the heap?. Not sure if that is even legal. Here's a simple Test program I was experimenting with. This doesn't work unless you declare fieldB like field A and C, and make the obvious changes in the public methods. #include <iostream> #include <stdlib.h> #include <string.h> #include <stdio.h> class Test { public: Test(void) { // field B must be alligned to page boundary // Is there a way to do this on the stack??? this->field.fieldB = (unsigned char*) valloc(10); }; //I know this is bad, this class is being treated like //a global structure. Its self contained in another class. unsigned char* PointerToFieldA(void) { return &this->field.fieldA[0]; } unsigned char* PointerToFieldB(void) { return this->field.fieldB; } unsigned char* PointerToFieldC(void) { return &this->field.fieldC[0]; } unsigned char* PointerToAllFields(void) { return &this->allFields[0]; } private: // Is this union possible with field B being // allocated on the heap? union { struct { unsigned char fieldA[10]; //This field has to be alligned to page boundary //Is there way to be declared on the stack unsigned char* fieldB; unsigned char fieldC[10]; } field; unsigned char allFields[30]; }; }; int main() { Test test; strncpy((char*) test.PointerToFieldA(), "0123456789", 10); strncpy((char*) test.PointerToFieldB(), "1234567890", 10); strncpy((char*) test.PointerToFieldC(), "2345678901", 10); char dummy[11]; dummy[10] = '\0'; strncpy(dummy, (char*) test.PointerToFieldA(), 10); printf("%s\n", dummy); strncpy(dummy, (char*) test.PointerToFieldB(), 10); printf("%s\n", dummy); strncpy(dummy, (char*) test.PointerToFieldC(), 10); printf("%s\n", dummy); char allFields[31]; allFields[30] = '\0'; strncpy(allFields, (char*) test.PointerToAllFields(), 30); printf("%s\n", allFields); return 0; }

    Read the article

< Previous Page | 163 164 165 166 167 168 169 170 171 172 173 174  | Next Page >