Search Results

Search found 29467 results on 1179 pages for 'public'.

Page 66/1179 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • How to better design it ???

    - by Deepak
    public interface IBasePresenter { } public interface IJobViewPresenter : IBasePresenter { } public interface IActivityViewPresenter : IBasePresenter { } public class BaseView { public IBasePresenter Presenter { get; set; } } public class JobView : BaseView { public IJobViewPresenter JobViewPresenter { get { this.Presenter as IJobViewPresenter;} } } public class ActivityView : BaseView { public IActivityViewPresenter ActivityViewPresenter { get { this.Presenter as IActivityViewPresenter;} } } Lets assume that I need a IBasePresenter property on BaseView. Now this property is inherited by JobView and ActivityView but if I need reference to IJobViewPresenter object in these derived classes then I need to type cast IBasePresenter property to IJobViewPresenter or IActivityPresenter (which I want to avoid) or create JobViewPresenter and ActivityViewPresenter on derived classes (as shown above). I want to avoid type casting in derived classes and still have reference to IJobViewPresenter or IActivityViewPresenter and still have IBasePresenter in BaseView. Is there a way I can achieve it ?

    Read the article

  • Is there a suitable public license for my needs (see body)?

    - by Ivan
    I would like to license my project with the flowing conditions: Personal and educational usage of the program and its source codes is to be free. In case of publishing of derivative works the original work and author (me) must be mentioned (incl. textual link to my website in a not-very-far-hidden place) and the derivative work must have different name. A derivative work can be closed-source. In every case of commercial (when the end-user is a commercial body (as a company (expect of non-profit companies), an individual entrepreneur or government office)) usage of my work or any of derivative works made by anyone, the end-user, service provider or the derivative author must buy a commercial license from me. I mean no guarantees or resoinsibilities, either expressed or implied... (except the case when one explicitly purchases a support service contract from me and the particular contract specifies a responsibility). Is there a known common license for this case? May it be OSI-approved?

    Read the article

  • Entity Framework 4 code-only reference column name

    - by Victor
    I created classes: public class Country { public long CountryId {get;set;} public string CountryName {get;set;} } public class Profile { public long ProfileId {get;set;} public string ProfileName {get;set;} public Country Country {get;set;} } and configuration for Profile: public class ProfileConfiguration : EntityConfiguration<Profile> { public IlluminatiCoreProfileConfiguration() { Relation(p => p.Country); } } Then I create context and run context.CreateDatabase(). New database contains table Profiles with column Country_CountryId. How can I write configuration for changing column name to "CountryId"? Thanks.

    Read the article

  • How can I create and use a web service in public but still restrict its use to only my app?

    - by Glenn
    I'm creating a web service with create/update/delete calls. But for now I'd like to restrict use of it on my own web app and no other clients. How can I have clear text javascript code that makes these calls but still be confident the credentials won't be used elsewhere? My idea is to use server side generated nonces for each request. But I am open to different ideas you guys may have. Thanks.

    Read the article

  • Is it good practice to put private API in the .m files and public API in .h files in Cocoa?

    - by Paperflyer
    Many of my classes in my current project have several properties and methods that are only ever called from within the class itself. Also, they might mess with the working of the class depending on the current state of the class. Currently, all these interfaces are defined in the main interface declaration in the .h files. Is it considered good practice to put the “private” methods and properties at the top of the .m files? This won't ever affect anything since I am very likely the only person ever to look at this source code, but of course it would be interesting to know for future projects.

    Read the article

  • String handle in C#

    - by Chelsea_cole
    I don't understand the use of "get" and "set" command, how to add a list of the accounts using the code below and someone give me some example to fix the error? Thanks! :( public class Account { public string UserName {get rerurn textBox1.Test; // error set UserName = textBox1.Text;} // error public string Password { get; set; } public string RePassword { get; set; } public string Name { get; set; } public string bd { get; set; } public string dt { get; set; } public string dc { get; set; } } public class ListAcc { static void Data() { List<Account> UserList = new List<Account>(); } }

    Read the article

  • how to start with a voip/public announcement project?

    - by Metiu
    The main requirements are: open source solution on Linux support P2P VoIP calls support presence support multicast VoIP announcements (and maybe some way of setting up such a "conference") preferably serverless (maybe the network can get split and I'd need to keep the functionality for all clients that still see each other) I tried looking at telepathy, in particular telepathy-salut, but it seems to be quite a new technology, so it lacks clear/good documentation and/or working examples. I'm also evaluating SIP (e.g. SofiaSIP), but it's working only if connected to a server.

    Read the article

  • Pass complex objects to MVC Get parameters

    - by VJ
    I am wanting to pass something like the following to my view from my controller via GET not POST: public class MyDTO { public string val1 { get; set; } public string val2 { get; set; } public MyObject obj { get; set; } } public class MyObject { public int SomeInt { get; set; } public string ACoolValue { get; set; } public string YetAnotherCoolValue { get; set; } } And then the controller would like like this. (Note it is a GET): public ActionResult MyView(MyDTO dto) { return View(dto) } The problem is that the instance of MyObject is coming back as null, where val1 and val2 have data. Has anyone run across this?

    Read the article

  • git: setting a single tracking remote from a public repo.

    - by Gauthier
    I am confused with remote branches. My local repo: (local) ---A---B---C-master My remote repo (called int): (int) ---A---B---C---D---E-master What I want to do is to setup the local repo's master branch to follow that of int. Local repo: (local) ---A---B---C---D---E-master-remotes/int/master So that when int changes to: (int) ---A---B---C---D---E---F-master I can run git pull from the local repo's master and get (local) ---A---B---C---D---E---F-master-remotes/int/master Here's what I have tried: git fetch int gets me all the branches of int into remote branches. This can get messy since int might have hundreds of branches. git fetch int master gets me the commits, but no ref to it, only FETCH_HEAD. No remote branch either. git fetch int master:new_master works but I don't want a new name every time I update, and no remote branch is setup. git pull int master does what I want, but there is still no remote branch setup. I feel that it is ok to do so (that's the best I have now), but I read here and there that with the remote setup it is enough with git pull. git branch --track new_master int/master, as per http://www.gitready.com/beginner/2009/03/09/remote-tracking-branches.html . I get "not a valid object name: int/master". git remote -v does show me that int is defined and points at the correct location (1. worked). What I miss is the int/master branch, which is precisely what I want to get. git fetch in master:int/master. Well, int/master is created, but is no remote. So to summarize, I've tried some stuff with no luck. I would expect 2 to give me the remote branch to master in the repo int. The solution I use now is option 3. I read somewhere that you could change some config file by hand, but isn't that a bit cumbersome? The "cumbersome" way of editting the config file did work: [branch "master"] remote = int merge = master It can be done from command line: $ git config branch.master.remote int $ git config branch.master.merge master Any reason why option 2 above wouldn't do that automatically? Even in that case, git pull fetches all branches from the remote.

    Read the article

  • Using enums or a set of classes when I know I have a finite set of different options?

    - by devoured elysium
    Let's say I have defined the following class: public abstract class Event { public DateTime Time { get; protected set; } protected Event(DateTime time) { Time = time; } } What would you prefer between this: public class AsleepEvent : Event { public AsleepEvent(DateTime time) : base(time) { } } public class AwakeEvent : Event { public AwakeEvent(DateTime time) : base(time) { } } and this: public enum StateEventType { NowAwake, NowAsleep } public class StateEvent : Event { protected StateEventType stateType; public MealEvent(DateTime time, StateEventType stateType) : base(time) { stateType = stateType; } } and why? I am generally more inclined to the first option, but I can't explain why. Is it totally the same or are any advantages in using one instead of the other? Maybe with the first method its easier to add more "states", altough in this case I am 100% sure I will only want two states: now awake, and now asleep (they signal the moments when one awakes and one falls asleep).

    Read the article

  • How to use @BeforeClass and @AfterClass in JunitPerf?

    - by allenzzzxd
    Hi, I want to do some actions before the whole test suite (also after the suite). So I wrote like: public class PerformanceTest extends TestCase { @BeforeClass public static void suiteSetup() throws Exception { //do something } @AfterClass public static void suiteSetup() throws Exception { //do something } @Before public void setUp() throws Exception { //do something } @After public void tearDown() throws Exception { //do something } public PerformanceTest(String testName){ super(testName); } public static Test suite() { TestSuite suite = new TestSuite(); Test testcase1 = new PerformanceTest("DoTest1"); Test loadTest1 = new LoadTest(testcase1, n); Test testcase2 = new PerformanceTest("DoTest2"); Test loadTest2 = new LoadTest(testcase2, n); } public void DoTest1 throws Throwable{ //do something } public void DoTest2 throws Throwable{ //do something } } But I found that it never reach the code in @BeforeClass and @AfterClass. So how could I do to solve this problem? Or is there other way to realize this? Thank you for your help.

    Read the article

  • How do I create a *public* Facebook community page using the Open Graph protocol?

    - by jmbledsoe
    I am trying to integrate pages from a site I am building into the Facebook Open Graph. My goal is to create a Facebook "Community Page" for each cause in my application. I have added Open Graph tags to a page so that I can Like it in Facebook, and a community page corresponding to my cause has been added to Facebook. However, I am the only one who can see the community page, since I am its administrator. All other users are redirected to the URL of the cause itself. My community page is at: http://www.facebook.com/pages/Kings-Hospital-Garden-Short-Term-Aid/123353527700762 When fans go to this page, I would like them to see the Facebook community page rather than being redirected. In other words, I want my community page to behave like the following community page referenced in all of the Facebook documentation on the subject: http://www.facebook.com/pages/The-Rock/109550739071923 Any insight into this would be greatly appreciated. Also, I asked this same question on the Facebook Platform Developer Forum, but I suspect that the SO community may be more quick to respond.

    Read the article

  • How to change aif to be able to access 'it' within the macrocall without making 'it' public in the package

    - by Sim
    If you put the aif code presented in onlisp in a package and try to use it in another you run in the problem that packagename:it is not external. (in-package :packagename) (defmacro aif (test-form then-form &optional else-form) ‘(let ((it ,test-form)) (if it ,then-form ,else-form))) wanted call syntax (in-package :otherpackage) (aif (do-stuff) (FORMAT t "~a~%" it) (FORMAT t "just got nil~%")) How can I fix this behavior in code, without making the variable it external in the package declaration and beeing able to access it just by it instead of packagename:it?

    Read the article

  • Is there any tips for minimising access to a public page without login?

    - by alex
    I have a page that is just a non interactive display for a shop window. Obviously, I don't link to it, and I'd also like to avoid people stumbling across it (by Google etc). It will always be powered by Chrome. I have thought of... Checking User Agent for Chrome Ensuring resolution is 1920 x 1080 (not that useful as it is a client side check) Banning under robots.txt to keep Google out of it Do you have any more suggestions? Should I not really worry about it?

    Read the article

  • What is the right way to pass class parameters to a method

    - by Schneider
    Let's suppose I have three classes A, B and C public class A { public int A1; public string A2; } public class B { public char B1; public double B2; public decimal B3; } public class C { public string DoSomething(A a, B b) { var a1 = a.A1; var b2 = b.B2; var b3 = b.B3; // DoSomething return string.Empty; } } If DoSomething() is using just some fields of the A and B classes, do you prefer to pass the whole object in parameters or create an intermediate class that has just the needed fields by the DoSomething method ?

    Read the article

  • PropertyGrid + interface

    - by nilphilus
    public interface ITest { void Somethink(); } public class Test1 : ITest { public void Somethink() { /* do stuff */ } public int Test1Property { get; set; } } public class Test2 : ITest { public void Somethink() { /* do stuff */ } public float Test2Property { get; set; } } //Main class public class MainClass { [TypeConverter(ExpandableObjectConverter)] public ITest test { get; set; } } Ok, i have sth like this. Instance of MainClass is selected by PropertyGrid. How to make a DropDownList of objects of classes which implement ITest (here Test1 and Test2)

    Read the article

  • Google App Engine datastore-primary key

    - by megala
    Hi, I've created a table in the Google App Engine Datastore. It contains the following FIELDS(GROUPNAME,GROUPID,GROUPDESC). How do I set GROUPID as the primary key? My code is as follows: @Entity @Table(name="group" , schema="PUBLIC") public class Creategroup { @Basic private String groupname; @Basic private String groupid; @Basic private String groupdesc; public void setGroupname(String groupname) { this.groupname = groupname; } public String getGroupname() { return groupname; } public void setGroupid(String groupid) { this.groupid = groupid; } public String getGroupid() { return groupid; } public void setGroupdesc(String groupdesc) { this.groupdesc = groupdesc; } public String getGroupdesc() { return groupdesc; } public Creategroup(String groupname, String groupid, String groupdesc ) { // TODO Auto-generated constructor stub this.groupname = groupname; this.groupid = groupid; this.groupdesc = groupdesc; } }

    Read the article

  • How to map inheritance with property returned other inheritance?

    - by dario-g
    Hi I have abstract class Vehicle and two classes that derive from: Car and ForkLift. public abstract class Vehicle { public EngineBase Engine { get; set; } } public class Car : Vehicle { public GasEngine Engine { get; set; } } public class ForkLift : Vehicle { public ElectricEngine Engine { get; set; } } and Engine clasess: public abstract class Engine { } public class GasEngine : Engine { } public class ElectricEngine : Engine { } Engines are mapped with "table per class hierarchy". With Vehicles I want to use the same pattern. How to map Engine class and derived with that Engine property?

    Read the article

  • C# Struct No Parameterless Constructor? See what I need to accomplish

    - by Changeling
    I am using a struct to pass to an unmanaged DLL as so - [StructLayout(LayoutKind.Sequential)] public struct valTable { public byte type; public byte map; public byte spare1; public byte spare2; public int par; public int min; public byte[] name; public valTable() { name = new byte[24]; } } The code above will not compile because VS 2005 will complain that "Structs cannot contain explicit parameterless constructors". In order to pass this struct to my DLL, I have to pass an array of struct's like so valTable[] val = new valTable[281]; What I would like to do is when I say new, the constructor is called and it creates an array of bytes like I am trying to demonstrate because the DLL is looking for that byte array of size 24 in each dimension. How can I accomplish this?

    Read the article

  • Correct way to protect a private API key when versioning a python application on a public git repo

    - by systempuntoout
    I would like to open-source a python project on Github but it contains an API key that should not be distributed. I guess there's something better than removing the key each time a "push" is committed to the repo. Imagine a simplified foomodule.py : import urllib2 API_KEY = 'XXXXXXXXX' urllib2.urlopen("http://example.com/foo?id=123%s" % API_KEY ).read() What i'm thinking is: Move the API_KEY in a second key.py module importing it on foomodule.py; i would then add key.py on .gitignore file. Same as 1 but using ConfigParser Do you know a good programmatic way to handle this scenario?

    Read the article

  • Preon library problem

    - by Kamahire
    I am using preon lib to parse binary data it contain short, int data The structure as follows @BoundNumber(size="32", byteOrder=ByteOrder.BigEndian) public int time;// @BoundString(size="2") public String alphaChar;// 2 byte array @BoundNumber(size="16", byteOrder=ByteOrder.BigEndian) public int code1;//short @BoundNumber(size="16", byteOrder=ByteOrder.BigEndian) public int code2;//short @BoundNumber(size="16", byteOrder=ByteOrder.BigEndian) public int code3;//short @BoundString(size="8") public String firstName;// 8 byte array @BoundString(size="8") public String middleName;// 8 byte array @BoundString(size="8") public String lastName;// 8 byte array @BoundNumber(size="16", byteOrder=ByteOrder.BigEndian) public int code4;//short I am getting correct values for code1, code2, code3 but for code4 it not giving me correct value. It always gives me 0(Zero); When I checked with position of byte array; it shows me correct value. Is there any kind padding require?

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >