Daily Archives

Articles indexed Monday May 17 2010

Page 17/112 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How to restrict an access to some of the functions at third level in Classes (OOPs)

    - by Shantanu Gupta
    I have created a class say A which has some functions defined as protected. Now Class B inherits A and class C inherits B. Class A has private default constructor and protected parameterized constructor. I want Class B to be able to access all the protected functions defined in Class A but class C can have access on some of the functions only not all the functions and class C is inheriting class B. How can I restrict access to some of the functions of Class A from Class C ? Class A { private A(){} protected A(int ){} } Class B : A {} CLass C:B { }

    Read the article

  • How to set permissions so two users can work on the same hg repository?

    - by John Mee
    Ubuntu: Jaunty Mercurial: 1.3.1 Access: ssh (users john and bob) File permission: -rw-rw---- 1 john john 129276 May 17 13:28 dirstate User: bob Command: 'hg st' Response: **abort: Permission denied: /our/respository/.hg/dirstate** Obviously mercurial can't let bob see the state because the file it needs to read belongs to me. So I change the permissions to allow bob to read the file and everything is fine, up until I next try to do something, whence the situations are reversed. Now he owns the file and I can't read it. So I set up a "committers" group and both john and bob belong to the group, but still mercurial fiddles with the ownership and permissions whenever one or other commits. How do we configure it so two different logins in the same group can commit to the same repository over ssh?

    Read the article

  • Android AccountManager API

    - by Steph
    Hi everyone, I'm struggling to understand the Android AccountManager API. As far as I got thinks working I can use the blockingGetAuthToken method and specify whether Android should provide a notification for user to allow or deny the request. Another possibility is to use getAuthToken and check if KEY_INTENT is returned. If that's the case I could start a new Activity where the user can confirm my request. My problem is that I would like to call one of these two methods from within a Service. Is there any chance to get a callback once the user has made a decision? Thanks for your help

    Read the article

  • NSTask executed only once

    - by Eimantas
    I'm having trouble executing different NSTask's. Same launchPath, different arguments. I have a class who's instances administer own NSTask objects and depending on arguments those instances were initialized with - dependent NSTask object is being created. I have two initializers: // Method for finished task - (void)taskFinished:(NSNotification *)aNotification { [myTask release]; myTask = nil; [self createTask]; } // Designated initializer - (id) init { self = [super init]; if (self != nil) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskFinished:) name:NSTaskDidTerminateNotification object:nil]; [self createTask]; } return self; } // Convenience initializer - (id)initWithCommand:(NSString *)subCommand { self = [self init]; if (self) { [self setCommand:subCommand]; } return self; } And here 's the createTask method: - (void)createTask { // myTask is a property defined as NSTask* myTask = [[NSTask alloc] init]; [myTask setLaunchPath:@"/usr/bin/executable"]; } Say I have 3 buttons. Each one creates different class instance with different NSTask objects. But problem is that only first one gets executed. The second ones does not even triger "click" event (via target-action). I think it could be cause of launchPath I'm trying to use, 'cause simple /bin/ls works fine. The same command in terminal has 0 return value (i.e. all is fine). Any guides or gotchas are much appreciated.

    Read the article

  • Storing image files, psd files, ai files, flash in subversion

    - by nishantcm
    Hi, Can I store large amounts of image files in subversion. My designers usually create these designs and store them anywhere on their pc and there's no system. Can I store the files in an svn repository. That way I can also protect my data against unauthorized access and its also easier to archive. What are your comments and is there any better way to do this? Thanks!

    Read the article

  • ldap integeration in ruby

    - by user163352
    I'm working on integrating ruby with ldap. And it's working fine. Created test.com in ldap and I can bind with it successfully. Then I created a new organizational unit company. Under company there are some users Now I want to bind with the users(authentication) under company organizational unit. I can access the user using Filter.eq But I want to bind with the users. Suggestions plz..

    Read the article

  • Available Coroutine Libraries in Java

    - by JUST MY correct OPINION
    I would like to do some stuff in Java that would be clearer if written using concurrent routines, but for which full-on threads are serious overkill. The answer, of course, is the use of coroutines, but there doesn't appear to be any coroutine support in the standard Java libraries and a quick Google on it brings up tantalising hints here or there, but nothing substantial. Here's what I've found so far: JSIM has a coroutine class, but it looks pretty heavyweight and conflates, seemingly, with threads at points. The point of this is to reduce the complexity of full-on threading, not to add to it. Further I'm not sure that the class can be extracted from the library and used independently. Xalan has a coroutine set class that does coroutine-like stuff, but again it's dubious if this can be meaningfully extracted from the overall library. It also looks like it's implemented as a tightly-controlled form of thread pool, not as actual coroutines. There's a Google Code project which looks like what I'm after, but if anything it looks more heavyweight than using threads would be. I'm basically nervous of something that requires software to dynamically change the JVM bytecode at runtime to do its work. This looks like overkill and like something that will cause more problems than coroutines would solve. Further it looks like it doesn't implement the whole coroutine concept. By my glance-over it gives a yield feature that just returns to the invoker. Proper coroutines allow yields to transfer control to any known coroutine directly. Basically this library, heavyweight and scary as it is, only gives you support for iterators, not fully-general coroutines. The promisingly-named Coroutine for Java fails because it's a platform-specific (obviously using JNI) solution. And that's about all I've found. I know about the native JVM support for coroutines in the Da Vinci Machine and I also know about the JNI continuations trick for doing this. These are not really good solutions for me, however, as I would not necessarily have control over which VM or platform my code would run on. (Indeed any bytecode manipulation system would suffer similar problems -- it would be best were this pure Java if possible. Runtime bytecode manipulation would restrict me from using this on Android, for example.) So does anybody have any pointers? Is this even possible? If not, will it be possible in Java 7? Edited to add: Just to ensure that confusion is contained, this is a related question to my other one, but not the same. This one is looking for an existing implementation in a bid to avoid reinventing the wheel unnecessarily. The other one is a question relating to how one would go about implementing coroutines in Java should this question prove unanswerable. The intent is to keep different questions on different threads.

    Read the article

  • Makefile to compile both C and Java programs at the same time

    - by user342745
    I have three programs that need to be compiled at the same time, 2 written in C and 1 in java. I had all three working with the Makefile when they were in C, but then switched one of them to java... is there a way to compile all 3 at once with the same makefile? Here is my current Makefile: CC=gcc JC=javac JFLAGS= -g CFLAGS= -Wall -g -std=c99 LDFLAGS= -lm .SUFFIXES: .java .class .java.class: $(JC) $(JFLAGS) $*.java CLASSES = kasiski.java kentry.java ALL= ic ftable kasiski all: $(ALL) ic: ic.o kasiski: $(CLASSES:.java=.class) ftable: ftable.o ic.o: ic.c ic.h ftable.o: ftable.c ftable.h .PHONY: clean clean: rm -rf core* *.class *.o *.gch $(ALL)

    Read the article

  • iphone scrolling ticker example?

    - by tbacos
    I'm looking at adding a user comment ticker to my iPhone/iPad polling app (Show of Hands). The comments would obviously need to be pulled from a central web source - either a database or perhaps even simple flat files. The ticker would also need to support basic controls (speed, pause, etc.) Can anyone that had tried doing something like this point me to your work and/or pass along any implemetation ideas? Thanks! -tony

    Read the article

  • Anchor Window to Screen Edges in C#/WPF

    - by Kirk
    I've decided to teach myself C# by writing a music player in Visual Studio 2010. I went with WPF because from what I hear it sounds like it will be a good base to skin from. I want to program my window with the behavior where if the window comes to the edge of a screen (within 10px or so) it will snap to the screen edge. What's the best way to go about this?

    Read the article

  • Use Automapper to flatten sub-class of property

    - by Neil
    Given the classes: public class Person { public string Name { get; set; } } public class Student : Person { public int StudentId { get; set; } } public class Source { public Person Person { get; set; } } public class Dest { public string PersonName { get; set; } public int? PersonStudentId { get; set; } } I want to use Automapper to map Source - Dest. This test obviously fails: Mapper.CreateMap<Source, Dest>(); var source = new Source() { Person = new Student(){ Name = "J", StudentId = 5 }}; var dest = Mapper.Map<Source, Dest>(source); Assert.AreEqual(5, dest.PersonStudentId); What would be the best approach to mapping this given that "Person" is actually a heavily used data-type throughout our domain model.

    Read the article

  • Windows Phone 7 For Silverlight Programmers

      This is the first in a series of mini-tutorials on Windows Phone 7 Programming for Silverlight Programmers. Goals: Rapid introduction to Win Phone 7 for experienced Silverlight Programmers Design and implementation of WP7 Silverlight HVP Audience: Silverlight Programmers who want to learn to program the new Windows Phone 7. Once the fundamentals are covered, the target [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Simple, free Mac OSX paint program with transparency

    - by Julie
    What FREE software (included with Mac OSX, or public domain) would be a good, simple way to take some existing PNG clipart files do some simple editing? I really only need to do 3 things: Rotate the image. Clip the image. Set a "transparent" color. I don't need anything that takes weeks to learn... or is super-powerful... or super expensive. Thanks.

    Read the article

  • Don’t Like New Google Search Interface? Switch To Old Interface

    - by Gopinath
    Google recently adopted a new user interface layout for it’s search engine. The new layout is very different to classic one, it provides many options on the left side to choose for enhanced search operations. Even though many users like this new interface, there are few who are more comfortable with the classic interface. If you are one among those who wanted to switch back to classic interface, you can access it by using the following http://www.google.com/webhp?hl=all Join us on Facebook to read all our stories right inside your Facebook news feed.

    Read the article

  • how to selectively filter items in a collection

    - by Samuel
    I use the following snippet to filter the list of selected users, where isSelected is a boolean variable. Is there a simpler way (helper function) to populate the selectedUsers collection instead of writing the following lines of code. List<User> selectedUsers = new ArrayList<User>(0); for (User user : this.getUsers()) { if (user.isSelected()) { selectedUsers.add(user.getId()); } }

    Read the article

  • How to make some functions of a class as private for third level of inheritance.

    - by Shantanu Gupta
    I have created a class say A which has some functions defined as protected. Now Class B inherits A and class C inherits B. Class A has private default constructor and protected parameterized constructor. I want Class B to be able to access all the protected functions defined in Class A but class C can have access on some of the functions only not all the functions and class C is inheriting class B. How can I restrict access to some of the functions of Class A from Class C ? Class A { private A(){} protected A(int ){} protected calc(){} protected allow(){} } Class B : A {} // calc() and allow() should be accessible here CLass C:B { // calc() should not be accessible here but allow() should be accessible here. }

    Read the article

  • javascript font size not working

    - by Fernando SBS
    why this don´t work: function rp_insertTable() { FM_log(3,"rp_insertTable() called"); var farmTable = dom.cn("table"); var ftableBody = dom.cn("tbody"); var i; var maximize = GM_getValue("Maximize_" + suffixGlobal, 0); farmTable.className = "FMtbg"; farmTable.id = "farmMachineTable"; farmTable.setAttribute('cellpadding', 2); farmTable.setAttribute('cellspacing', 1); farmTable.style.marginBotton = "12px"; farmTable.style.font = "bold 12px arial,serif"; farmTable.style.font = "bold 12px arial,serif"; the font does change in format, but the font size is not working, I can put 100px and it deosn´t change anything, why is that?

    Read the article

  • objc[989] objc_exception_throw failed.

    - by thyrgle
    I was just adding some more CCSprites to a CCLayer and it just starts crashing giving me the error: objc[989] objc_exception_throw failed. Is there like a limit to the amount of CCSprites you can have on a screen or something? I added the CCSprites doing the following with the CCSprites already declared at interface: L1Circle1 = [CCSprite spriteWithFile:@"LaserCircle.png"]; [L1Circle1 setPosition:ccp(180,180)]; [self addChild:L1Circle1]; What am I doing wrong?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >