Search Results

Search found 8253 results on 331 pages for 'secure coding'.

Page 29/331 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • Accepting a numerical range in a function call

    - by dekpos
    I have encountered two ways of doing it: void foo(int from, int to); /* 'from' inclusive, 'to' exclusive */ void foo(int startIndex, int rangelength); Has one style historically been preferred over the other? If so, was it just a matter of convention or was it due to some deeper underlying reason? I'm currently programming in Java and noticed that the Arrays class uses the former style. The exclusivity of the to argument felt somewhat unintuitive to me, which led me to ask this question.

    Read the article

  • Estimates, constraint and design [closed]

    - by user65964
    For your next two software projects (assuming that you're getting programming assignments, otherwise consider the program to find the min and max of a set of rational numbers) estimate how much effort they would take before doing them, then keep track of the actual time spent. How accurate were your estimates? State the requirements, constraint, design, estimate (your original estimate and the actual time it took), implementation (conventions used, implement/test path followed.

    Read the article

  • Should Equality be commutative within a Class Hierachy?

    - by vossad01
    It is easy to define the Equals operation in ways that are not commutative. When providing equality against other types, there are obviously situations (in most languages) were equality not being commutative is unavoidable. However, within one's own inheritance hierarchy where the root base class defines an equality member, a programmer has more control. Thus you can create situations where (A = B) ? (B = A), where A and B both derive from base class T Substituting the = with the appropriate variation for a given language. (.Equals(_), ==, etc.) That seems wrong to me, however, I recognize I may be biased by background in Mathematics. I have not been in programming long enough to know what is standard/accepted/preferred practice when programming. Do most programmers just accept .Equals(_)may not be commutative and code defensibly. Do they expect commutativity and get annoyed if it is not. In short, when working in a class hierarchy, should effort me made to ensure Equality is commutative?

    Read the article

  • Array sum of difference of first smallest k elment

    - by prateeak ojha
    Hi i come across this challenge on an online programing challange the task is so simple for ex WE have to variable N and K where N is where N is lenght of array and we have to find sum of duiffrence of K smallest element of array as Sample Input 10 4 1 2 3 4 10 20 30 40 100 200 Sample Output 10 Explanation #0 We have 10 as N size of array and K is 4 here the next N values are array's elments in order to find sum of diffrences we will takek smallest values from array which are 1,2,3,4 then will perform operation(sum of difference) as |1-2| + |1-3| + |1-4| + |2-3| + |2-4| + |3-4| = 10 I tried solving the problem and found a way through which i can solve the problem wit N^3 complexity but my solution is rejected i need a approach to solve the problem with n complexity i still can't figure out a way .. looked at some solution but coud'nt find the exact way to approach. if anybody have a better idea and would like to share it would be appreciable thanks in advance

    Read the article

  • Naming the implementation version of an interface function

    - by bolov
    When I need to write an implementation version of an interface function, I put the implementation function within a impl namespace, but with the same name as the interface function. Is this a bad practice? (the same name part, the namespace part I am confident it’s more than OK). For me, who I write the code, there is no confusion between the two, but I want to make sure this isn’t confusing for someone else. One other option would be to append impl suffix to the function name, but since it is already in a separate namespace named impl it seems redundant. Is there an idiomatic way to do this? E.g.: namespace n { namespace impl { // implementation function (hidden from users) // same name, is it ok? void foo() { // ... //sometimes it needs to call recursively or to call overloads of the interface version: foo(); // calls the implementation version. Is this confusing? n::foo(); // calls the interface version. Is this confusing? // ... } // namespace impl // interface function (exposed to users) void foo() { impl::foo(); } } // namespace n

    Read the article

  • How to start learning Programming? [on hold]

    - by user107080
    Most of the time people ask which programming language to learn which I know is not valid question to ask here and I don't care about 'which' here, I care about 'How'. So, how do I start learning programming from scratch? in other words, what are the steps for absolute beginner to learn programming the right way? I'm sure buying a book and reading it is not the only way in this case. Again, I don't want to ask which but I want also to know if there are specific languages that will make my start as solid as possible because I know that some can hurt my mindset of programming point of view.

    Read the article

  • Single statement if block - braces or no? [on hold]

    - by Zannjaminderson
    Which is better/more generally accepted? This: if(condition) { statement; } Or: if(condition) statement; I tend to prefer the first one, because I think it makes it easier to tell what actually belongs in the if block, it saves others from adding the braces later (or creating a bug by forgetting to), and it makes all your if statements uniform instead of some with braces and some without. The second one, however, is still syntactically correct and definitely more compact. I'm curious to see which is more generally preferred by others though.

    Read the article

  • Php sessions secure log in

    - by Doodle
    My question is about creating a secure log in routine. After comparing the user name and password to the stored values I set a session variable called logged to true. Then as the user surfs around the web page I just check the logged variable for true or false to determine if the user should have access. This is my first time creating something like this. Is this secure? I feel like there is something else that I should be doing to make sure that users are valid.

    Read the article

  • Convert ASP.NET membership system to secure password storage

    - by wrburgess
    I have a potential client that set up their website and membership system in ASP.NET 3.5. When their developer set up the system, it seems he turned off the security/hashing aspect of password storage and everything is stored in the clear. Is there a process to reinstall/change the secure password storage of ASP.NET membership without changing all of the passwords in the database? The client is worried that they'll lose their customers if they all have to go through a massive password change. I've always installed with security on by default, thus I don't know the effect of a switchover. Is there a way to convert the entire system to a secure password system without major effects on the users?

    Read the article

  • Portable and Secure Document Repository

    - by Sivakanesh
    I'm trying to find a document manager/repository (WinXP) that can be used from a USB disk. I would like a tool that will allow you to add all documents into a single repository (or a secure file system). Ideally you would login to this portable application to add or retrieve a document and document shouldn't be accessible outside of the application. I have found an application called Benubird Pro (app is portable) that allows you to add files to a single repository, but downsides are that it is not secure and the repository is always stored on the PC and not on the USB disk. Are you able to recommend any other applications? Thanks

    Read the article

  • PHP codinh in real world

    - by user261002
    I know how to write program in PHP and implementation of MVC model. but I really want to practice coding like the coding in real world??? I was wondering is there any specific example or book which can show me the tricks or logic and the way professional programmers consider about coding???

    Read the article

  • How to test for secure SMTP mail service on a mail server

    - by Vinay S Shenoy
    I'm working on a project to auto-configure a user's email server settings in Java. I am extracting the mail server from his email address and looking up the MX records of that mail server using the DirContext class with com.sun.jndi.dns.DnsContextFactory. Then I'm opening a Socket to each server and testing them using a HELO command and checking the responses. My problem is that this works only when I test it with the unsecure SMTP port 25. How can I use it with the secure port 465? I tried using Secure Sockets by using SSLSocketFactory sslsocketfactory = (SSLSocketFactory)SSLSocketFactory.getDefault(); SSLSocket socket = (SSLSocket)sslsocketfactory.createSocket(mailserver, STANDARD_SMTP_PORT); But all connections get a timeout exception as follows alt1.gmail-smtp-in.l.google.com. java.net.ConnectException: Operation timed out Please help.

    Read the article

  • Established javascript solution for secure registration & authentication without SSL

    - by Tomas
    Is there any solution for secure user registration and authentication without SSL? With "secure" I mean safe from passive eavesdropping, not from man-in-the-middle (I'm aware that only SSL with signed certificate will reach this degree of security). The registration (password setup, i.e. exchanging of pre-shared keys) must be also secured without SSL (this will be the hardest part I guess). I prefer established and well tested solution. If possible, I don't want to reinvent the wheel and make up my own cryptographic protocols. Thanks in advance.

    Read the article

  • (Secure) alternative to TLS / SSLv3 ?

    - by CSkau
    Toying with an idea for a F2F networked application I've just been reading up on secure communication. I quickly settled with the idea of using TLS / SSL as the basis for any communication since it employs Public Key encryption at the protocol level and thus is perfect for my needs. However I was surprised to read (on wikipedia) that the newest version of TLS, SSLv3 uses a mix of MD5 and SHA-1 "because if any vulnerability was found in one of these algorithms the other would prevent it from compromising SSLv3". However, as I take it, lately both have been found flawed ! So my questions are thus: Does this not mean that SSLv3 is basically flawed, or am I not reading close enough ? And if so does a "secure" alternative to SSLv3 exist ?

    Read the article

  • uitextfield secure

    - by D_R
    I have a UITexetField with "Secure" option enabled in InterfaceBuilder (used to enter a password). Then I try to read, what the user entered. (void)textFieldDidEndEditing:(UITextField *)textField{ NSString *txt = textField.text; int a = 0; } It works fine with iOS 5 but since I use it in iOS6, this method no longer works - neither in simulator, nor at the real device. It was called, but textField.text returns always an empty string. With other UITextFields, without "Secure" option, it works fine. Could somebody help me ?

    Read the article

  • Is keeping uploads folder outside of 'public_html' enough to keep my application secure from malicio

    - by ecu
    Although I realise there are different approaches to securing upload process, I'm still confused when it comes to basic principles. I want to allow users to upload any kind of file they want, but keep my app secure. So my question is: Is it sufficient to store the files with their original names in 'uploads' folder outside 'webroot' and fetching them via some download.php script? If it't not secure enough, please point me in the right direction, or suggest what additional steps I should take to make it safe. Thank you.

    Read the article

  • Secure method for linking to image files uploaded via custom CMS

    - by letseatfood
    How does one provide a direct URL for an image file (JPEG) that is secure? For example, if a PHP script writes uploaded images to directory http://www.somehost.com/images, is it okay to provide http://www.somehost.com/images/someimage.jpg as the URL, or is there a more secure way to do this? Should I look into something like the permalink feature that is a part of Wordpress? I am not sure if that is related. The main reason I ask is that I have a custom PHP/MySQL CMS for managing images. I would like for the client to be able to copy a link to the image they want and then include it in a TinyMCE text editor for inserting the image in their website. Thanks!

    Read the article

  • Getting the current EnvDTE or IServiceProvider when NOT coding an Addin

    - by Vaccano
    I am coding up some design time code. I want to use this snippet: (Found here) var dte = (EnvDTE.DTE) GetService(typeof(EnvDTE.DTE)); if (dte != null) { var solution = dte.Solution; if (solution != null) { string baseDir = Path.GetDirectoryName(solution.FullName); } } Problem is that this does not compile. (GetService is not a known method call) I tried adding Microsoft.VisualStudio.Shell (and Microsoft.VisualStudio.Shell.10.0) but it did not help. In looking around on the internet I found that you need a IServiceProvider to call this. But all the examples that show how to get an IServiceProvider use a EnvDTE. So, to get the current EnvDTE I need IServiceProvider. But to get an IServiceProvider I need an EnvDTE. (There is a hole in my bucket...) So, here is my question: In a normal WPF Application, how can I get the current instance of EnvDTE? NOTE: I am not looking for any old instance of EnvDTE. I need the one for my current Visual Studio instance (I run 3-4 instances of Visual Studio at a time.)

    Read the article

  • Factories, or Dependency Injection for object instantiation in WCF, when coding against an interface

    - by Saajid Ismail
    Hi I am writing a client/server application, where the client is a Windows Forms app, and the server is a WCF service hosted in a Windows Service. Note that I control both sides of the application. I am trying to implement the practice of coding against an interface: i.e. I have a Shared assembly which is referenced by the client application. This project contains my WCF ServiceContracts and interfaces which will be exposed to clients. I am trying to only expose interfaces to the clients, so that they are only dependant on a contract, not any specific implementation. One of the reasons for doing this is so that I can have my service implementation, and domain change at any time without having to recompile and redeploy the clients. The interfaces/contracts will in this case not change. I only need to recompile and redeploy my WCF service. The design issue I am facing now, is: on the client, how do I create new instances of objects, e.g. ICustomer, if the client doesn't know about the Customer concrete implementation? I need to create a new customer to be saved to the DB. Do I use dependency injection, or a Factory class to instantiate new objects, or should I just allow the client to create new instances of concrete implementations? I am not doing TDD, and I will typically only have one implementation of ICustomer or any other exposed interface.

    Read the article

  • C#,coding with AES

    - by lolalola
    Hi, why i can coding only 128 bytes text? Work: string plainText = "1234567890123456"; Don't work: string plainText = "12345678901234561"; Don't work: string plainText = "123456789012345"; string plainText = "1234567890123456"; byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); byte[] keyBytes = System.Text.Encoding.UTF8.GetBytes("1234567890123456"); byte[] initVectorBytes = System.Text.Encoding.UTF8.GetBytes("1234567890123456"); RijndaelManaged symmetricKey = new RijndaelManaged(); symmetricKey.Mode = CipherMode.CBC; symmetricKey.Padding = PaddingMode.Zeros; ICryptoTransform encryptor = symmetricKey.CreateDecryptor(keyBytes, initVectorBytes); MemoryStream memoryStream = new MemoryStream(); CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write); cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length); cryptoStream.FlushFinalBlock(); byte[] cipherTextBytes = memoryStream.ToArray(); memoryStream.Close(); cryptoStream.Close(); string cipherText = Convert.ToBase64String(cipherTextBytes); Console.ReadLine();

    Read the article

  • Doing coding in Linux through a virtual machine on Windows VS partitioning

    - by ihaveitnow
    I already have experience with setting up virtual machines, running them and other minor tasks. Im a gamer, so I wont get rid of windows (for now at least...) but I do want to be a great programmer and to be involved with the Open-Source community. Id like to know if its a good idea to do my programming in linux through a virtual machine, vs giving it a partitioned section of the HDD. Id like to know about performance pros and cons and functionality. All responses are appreciated, thanks in advance. The type of programming I intend to dive into : Android Dev, Web Dev, Desktop Dev...More Android and Web right now though. So im looking at C#,C,C++,Java,PHP,HTML,MySQL...Off the top of the dome. I do web designing as well, so dreamweaver is added as an "essential". But im sure I can do dreamweaver files and upload them to the server after programming in Linux...Right? And any info on IDE's in Linux for the above mentioned are appreciated, but i would prefer going the coding route and understanding the essence of whats happening "under the covers" Thanks to all for reading, I appreciate it. Hope this isnt confusing :S

    Read the article

  • Better way of coding this if statment?

    - by HadlowJ
    Hi. I have another question for you very helpful people. I use a lot of if statements many of which are just repeated and im sure could be shortened. This is my current bit of code if (Globals.TotalStands <= 1) { ScoreUpdate.StandNo2.Visible = false; ScoreUpdate.ScoreStand2.Visible = false; ScoreUpdate.ScoreOutOf2.Visible = false; } if (Globals.TotalStands <= 2) { ScoreUpdate.StandNo3.Visible = false; ScoreUpdate.ScoreStand3.Visible = false; ScoreUpdate.ScoreOutOf3.Visible = false; } if (Globals.TotalStands <= 3) { ScoreUpdate.StandNo4.Visible = false; ScoreUpdate.ScoreStand4.Visible = false; ScoreUpdate.ScoreOutOf4.Visible = false; } if (Globals.TotalStands <= 4) { ScoreUpdate.StandNo5.Visible = false; ScoreUpdate.ScoreStand5.Visible = false; ScoreUpdate.ScoreOutOf5.Visible = false; } if (Globals.TotalStands <= 5) { ScoreUpdate.StandNo6.Visible = false; ScoreUpdate.ScoreStand6.Visible = false; ScoreUpdate.ScoreOutOf6.Visible = false; } if (Globals.TotalStands <= 6) { ScoreUpdate.StandNo7.Visible = false; ScoreUpdate.ScoreStand7.Visible = false; ScoreUpdate.ScoreOutOf7.Visible = false; } if (Globals.TotalStands <= 7) { ScoreUpdate.StandNo8.Visible = false; ScoreUpdate.ScoreStand8.Visible = false; ScoreUpdate.ScoreOutOf8.Visible = false; } as you can see there is a huge amount of code to do something simple (which i do on a few other forms as well and im sure there must be a better way of coding this that gets the same result? Im a code noob so please be gentle, code is c# and software is visual studio 2008 pro. Thanks

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >