Daily Archives

Articles indexed Friday April 2 2010

Page 11/105 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Overly accessible and incredibly resource hungry relationships between business objects. How can I f

    - by Mike
    Hi, Firstly, This might seem like a long question. I don't think it is... The code is just an overview of what im currently doing. It doesn't feel right, so I am looking for constructive criticism and warnings for pitfalls and suggestions of what I can do. I have a database with business objects. I need to access properties of parent objects. I need to maintain some sort of state through business objects. If you look at the classes, I don't think that the access modifiers are right. I don't think its structured very well. Most of the relationships are modelled with public properties. SubAccount.Account.User.ID <-- all of those are public.. Is there a better way to model a relationship between classes than this so its not so "public"? The other part of this question is about resources: If I was to make a User.GetUserList() function that returns a List, and I had 9000 users, when I call the GetUsers method, it will make 9000 User objects and inside that it will make 9000 new AccountCollection objects. What can I do to make this project not so resource hungry? Please find the code below and rip it to shreds. public class User { public string ID {get;set;} public string FirstName {get; set;} public string LastName {get; set;} public string PhoneNo {get; set;} public AccountCollection accounts {get; set;} public User { accounts = new AccountCollection(this); } public static List<Users> GetUsers() { return Data.GetUsers(); } } public AccountCollection : IEnumerable<Account> { private User user; public AccountCollection(User user) { this.user = user; } public IEnumerable<Account> GetEnumerator() { return Data.GetAccounts(user); } } public class Account { public User User {get; set;} //This is public so that the subaccount can access its Account's User's ID public int ID; public string Name; public Account(User user) { this.user = user; } } public SubAccountCollection : IEnumerable<SubAccount> { public Account account {get; set;} public SubAccountCollection(Account account) { this.account = account; } public IEnumerable<SubAccount> GetEnumerator() { return Data.GetSubAccounts(account); } } public class SubAccount { public Account account {get; set;} //this is public so that my Data class can access the account, to get the account's user's ID. public SubAccount(Account account) { this.account = account; } public Report GenerateReport() { Data.GetReport(this); } } public static class Data { public static List<Account> GetSubAccounts(Account account) { using (var dc = new databaseDataContext()) { List<SubAccount> query = (from a in dc.Accounts where a.UserID == account.User.ID //this is getting the account's user's ID select new SubAccount(account) { ID = a.ID, Name = a.Name, }).ToList(); } } public static List<Account> GetAccounts(User user) { using (var dc = new databaseDataContext()) { List<Account> query = (from a in dc.Accounts where a.UserID == User.ID //this is getting the user's ID select new Account(user) { ID = a.ID, Name = a.Name, }).ToList(); } } public static Report GetReport(SubAccount subAccount) { Report report = new Report(); //database access code here //need to get the user id of the subaccount's account for data querying. //i've got the subaccount, but how should i get the user id. //i would imagine something like this: int accountID = subAccount.Account.User.ID; //but this would require the subaccount's Account property to be public. //i do not want this to be accessible from my other project (UI). //reading up on internal seems to do the trick, but within my code it still feels //public. I could restrict the property to read, and only private set. return report; } public static List<User> GetUsers() { using (var dc = new databaseDataContext()) { var query = (from u in dc.Users select new User { ID = u.ID, FirstName = u.FirstName, LastName = u.LastName, PhoneNo = u.PhoneNo }).ToList(); return query; } } }

    Read the article

  • SQL SERVER Simple Installation of Master Data Services (MDS) and Sample Packages Very Easy

    I twitted recently about: ‘Installing #sql Server 2008 R2 – Master Data Services. Painless.‘ After doing so, I got quite a few emails from other users as to why I thought it was painless. The reason was very simple- I was able to install it rather quickly on my laptop without any issues. There were [...]...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

  • Where would a wildcard DNS record be prioritized?

    - by Kyle
    I have a DNS setup going on where I have several subdomains that cname out to google apps, but I was wondering if I could wildcard the rest of my subdomains, and have my google apps cname correctly. In other words, would the records that aren't a wildcards be parsed before the wildcard record?

    Read the article

  • What do you use for a RAM disk on Windows Server?

    - by thelsdj
    We currently use AR Soft RAM Disk on some Windows 2003 servers for storing short lived temporary files. Looking forward to a move to 64-bit Windows Server 2008 I'm wondering what options there are for a RAM disk since it appears AR Soft RAM Disk was discontinued in 2005. I'm not looking for any physical disk backing, just a pure RAM disk that appears like a normal drive to Windows. Does anyone have any experience with RAM disks on Windows Server 2008, especially for 64-bit?

    Read the article

  • Does any upgrade version of Visual Studio require an installed development tool?

    - by Will Eddins
    I'm wondering this from a legal standpoint and an installation-issue standpoint. I'm considering pre-ordering Visual Studio 2010 for future use in some home projects, and you cannot pre-order a full version, only an upgrade version. On the preorder page, it says: Eligible for upgrade with any previous version of Visual Studio or any other developer tool. In reality, I think it won't require anything installed, but from a legal standpoint, is this inclusive with development tools such as Eclipse? After installing Windows 7 on this PC, Eclipse is currently the only IDE I have installed. But really anything could be considered a developer tool, such as Notepad++ or Kaxaml. How has this worked in regards to previous upgrade versions?

    Read the article

  • [OpenGl] Loading new texture into already defined texture name

    - by Dan Vogel
    I have an OpenGl program in which I am displaying an image using textures. I want to be able to load a new image to be displayed. In my Init function I call: Gl.glGenTextures(1, mTextures); Since only one image will be displayed at time, I am using the same texture name for each image. Each time a new image is loaded I call the following: Gl.glBindTexture(Gl.GL_TEXTURE_2D, mTexture[0]); Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_LUMINANCE, mTexSizeX, mTexSizeY, 0, Gl.GL_LUMINANCE, Gl.GL_UNSIGNED_SHORT, mTexBuffer); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_LINEAR); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_LINEAR); The first image will display as expected. However, all images load after the first, display as all black. What am I doing wrong?

    Read the article

  • cake's Acl problems...

    - by Gaurav
    I created an application using the method described in the "http:// book.cakephp.org/view/641/Simple-Acl-controlled-Application" but after I try to log in there is an error which says, "DbAcl::allow() - Invalid node [CORE\cake\libs\controller\components\acl.php, line 325]" I did exactly same as mentioned in the website but after loggin in I am given this error msg.. Please help me rectify this. Any help is greatly appreciated..... thanks gaurav sharma

    Read the article

  • Strip All Urls From A Mixed String ( php )

    - by Axel
    Hi, i reposted this question because i didn't find a good answer. i have a string which can contains text with urls. i want a function to strip all urls from this string and just let the text. by example the string can contains like this : 1) hey take a look here : http://xxx.xxx/545df5 this is nice! 2) hey take a look here : http://www.xxx.xxx/545df5 this is nice! 3) hey take a look here : xxx.xxx/545df5 this is nice! 4) hey take a look here : www.xxx.xxx/545df5 this is nice! Thanks

    Read the article

  • ASP.NET page to image or pdf.

    - by leduchuy89vn
    Hi everybody. I have an asp .net page like this: http://farm4.static.flickr.com/3631/3690714302_c17b259863.jpg My Table is Gridview and some Label, anybody can tell me how to create a button to convert my page to image or pdf file and save it to desktop. Help me please T__T.

    Read the article

  • How do I add programmatically-generated new files to source control?

    - by Alex Basson
    This is something I've never really understood about source control, specifically Subversion (the only source control I've ever used, which isn't saying much). I'm considering moving to git or Mercurial, so if that affects the answer to my question, please indicate as such. Ok. As I understand it, every time I create a new file, I have to tell SVN about it, so that it knows to add it to the repository and place it under control. Something like: svn add newfile That's fine if I'm the one creating the file: I know I created it, I know its name, I know where it lives, so it's easy to tell SVN about it. But now suppose I'm using a framework of some kind, like Rails, Django, Symfony, etc., and suppose I've already done the initial commit. All of these frameworks create new files programmatically, often many at once, in different directories, etc. etc. How do I tell the source control about these new files? Do I have to hunt each one of them down individually and add them? Is there an easier way? (Or am I possibly misunderstanding something fundamental about source control?)

    Read the article

  • Which information (files) of an eclipse-workspace should be tracked by source control

    - by Phuong Nguyen de ManCity fan
    I want to track the workspace of eclipse by source control so that important settings can be backed up. However, there are a lot of kind of *.index inside the .metadata folder of workspace. Some information are important, for example Mylyn repository, but some information is merely cached files and thus, doesn't make sense to me for being tracked. In short, what files inside eclipse workspace that should be tracked so that I can restore the working workspace after problems (like meta data file deleted, etc.)

    Read the article

  • Should I put my output files in source control?

    - by sebastiaan
    I've been asked to put every single file in my project under source control, including the database file (not the schema, the complete file). This seems wrong to me, but I can't explain it. Every resource I find about source control tells me not to put generated output files in a source control system. And I understand, it's not "source" files. However, I've been presented with the following reasoning: Who cares? We have plenty of bandwidth. I don't mind having to resolve a conflict each time I get the latest revision, it's just one click It's so much more convenient than having to think about good ignore files Also, if I have to add an external DLL file in the bin folder now, I can't forget to put it in source control, as the bin folder is not being ignored now. The simple solution for the last bullet-point is to add the file in a libraries folder and reference it from the project. Please explain if and why putting generated output files under source control is wrong.

    Read the article

  • loops and array help

    - by dalton
    public void arrayCalculation(int[][]scores,float[]averages, int[]temp) { int total; for(int a=0; a<5; a++) { for (int b=0; b<5; b++) { scores[a][b] = temp[a+b*5]; } } for(int a = 0; a <5; a++) { total = total + scores[a]; } scores[5][0] = total; } i need to add up the values stored in the first row and store it in the 6th positon in the row

    Read the article

  • Choosing a source control system: logical next steps after VSS

    - by Dave
    I've been using Git for the past few months and love it. I looked into how to host it in a corporate environment. Considering a 10 person team who use Visual SourceSafe, programming in Coldfusion, Powerbuilder, PHP and a bit of .NET, I found, to my surprise, that the Git 'server' tooling is still fairly rudimentary. http://stackoverflow.com/questions/1761054/git-in-a-company-hosting-own-server Question Apart from SVN, what other source control options would be a logical next step after VSS? Paid options are fine. Something with nice tooling, that isn't scary would be great :-)

    Read the article

  • SFTP file transfer

    - by muthu
    hi iam totaly new to this area i have a requiremnet in transfering file to a SFTP site during which i need a proper LOG file and i also want to retry the transfer on any transaction error occurs or the network error and i also wan to log the errors. i also gone throug sftp and curl in which iam unable to satisfy the requirements. Thanks, Muthu

    Read the article

  • How to Detect Right Click on the Taskbar

    - by Zay
    I've got a Windows Forms application in C# that starts off with a loading dialog. As expected, a button for the app shows up in the Windows taskbar. I would like to detect right-clicks that might be done to that button. Ultimately, I hope to disable the right-click or simply have the loading dialog regain focus. I've seen that some people use custom libraries and packages (interop, for example) to achieve some Win32 functionality, but I'd personally like to avoid this. Is it impossible to do without such libraries/packages?

    Read the article

  • configure cisco catalyst 3560g with an egress uplink

    - by imaginative
    Currently my setup has our egress uplink connected directly to an external interface on a linux router/firewall/nat gateway. Since the linux box is a single point of failure, I've since setup two openbsd boxes using carp+pf+pfsync in order to gain some additional redundancy. the problem is, I only have one egress uplink (it's still a single point of failure) but need to get it to speak to the active carp node in my openbsd cluster which will server as my new router/firewall/nat cluster. Is there anything specific I need to do on a 3560G in order for me to be able to: 1) Drop the egress uplink into a port 2) Drop one link from the switch to a firewall 2) Drop a second link from a switch to the firewall This is so if one box dies, the other still has the egress link to the switch. Is putting them into one VLAN enough? Anything else that needs to go into the configuration for this setup to work?

    Read the article

  • Using unixODBC to connect to Oracle server

    - by Paul
    I am trying to configure our web server (RHEL 5.4 x86) to connect to an Oracle database using unixODBC. I have installed unixODBC-2.2.11-7.1.1, which yum tells me is the latest version. I have also installed the Oracle InstantClient 11.2 and the Oracle InstantClient ODBC library. I have symlinked the all the .so files in /usr/lib/oracle/11.2/client/lib to /usr/lib. I have set $LD_LIBRARY_PATH to /usr/lib/, $ORACLE_HOME to /usr/lib/oracle and $TNS_ADMIN to the directory containing my (valid) Tnsnames.ora file. Here are the contents of my /etc/odbcinst.ini file: [Oracle] Description = Oracle ODBC Connection Driver = /usr/lib/libsqora.so.11.1 Setup = FileUsage = and my /etc/odbc.ini file: [Oracle] Application Attributes = T Attributes = W BatchAutocommitMode = IfAllSuccessful CloseCursor = F DisableDPM = F DisableMTS = T Driver = Oracle EXECSchemaOpt = EXECSyntax = T Failover = T FailoverDelay = 10 FailoverRetryCount = 10 FetchBufferSize = 64000 ForceWCHAR = F Lobs = T Longs = T MetadataIdDefault = F QueryTimeout = T ResultSets = T ServerName = //<host>:<port>/<db> SQLGetData extensions = F Translation DLL = Translation Option = 0 UserID = (ServerName has been edited...host, port, and db are actually there, and correct) When I run isql I get $ isql -v Oracle isql: symbol lookup error: /usr/lib/libsqora.so.11.1: undefined symbol: SQLGetPrivateProfileStringW And running dltest gives me $ dltest Oracle SQLConnect [dltest] ERROR dlopen: Oracle: cannot open shared object file: No such file or directory If anyone has any insights I would be grateful, I've been trying to get this to connect for about 5 hours now... I am going home for the night, but will gladly provide more details, if necessary, tomorrow morning, to anyone willing to help...

    Read the article

  • Blackberry Gmail password change

    - by Highstead
    I've updated my gmail password and so i must update my blackberry password. I tried updating the email password to which i got the following message. Invalid email address or password. Please verify your email address and password. The information you provided is incorrect. If the error persists contact gmail.com (Your email provider). Please try again. I tried again, with what i know the password to be, with password show on. I've also deleted the account and tried to create it. I've tried going to the "Last account activity: XXXX details" menu and signing out all devices. I'm continually getting the above error, but the account activities don't seem to show any sign of a mobile attempt to access my mail account. Has anyone had this issue before and how did you sign it. Thanks in advance.

    Read the article

  • Audio doesn't work on Windows XP guest (WS 7.0)

    - by Mads
    Hi, I can't get audio to work with on a Windows XP guest running on VMware Workstation 7.0 and Ubuntu 9.10 host. Windows fails to produce any audio output and the Windows device manager says the Multimedia Audio Controller is not working properly. Audio is working fine in the host OS. When I open Multimedia Audio Controller properties it says: Device status: The drivers for this device are not installed (Code 28) If I try to reinstall the driver I get the following error message: "Cannot Install this Hardware There was a problem installing this hardware: Multimedia Audio Controller An Error occurred during the installation of the device Driver is not intended for this platform" Has anyone else experienced this problem?

    Read the article

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