Search Results

Search found 4835 results on 194 pages for 'practice'.

Page 23/194 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Starting a personal reuasable code repository.

    - by Rob Stevenson-Leggett
    Hi, I've been meaning to start a library of reusable code snippets for a while and never seem to get round to it. At the moment I just tend to have some transient classes/files that I drag out of old projects. I think my main problems are: Where to start. What structure should my repository take? Should it be a compiled library (where appropriate) or just classes/files I can drop into any project? Or a library project that can be included? What are the licencing implications of that? In my experience, a built/minified library will quickly become out of date and the source will get lost. So I'm leaning towards source that I can export from SVN and include in any project. Intellectual property. I am employeed, so a lot of the code I write is not my IP. How can I ensure that I don't give my own IP away using it on projects in work and at home? I'm thinking the best way would be to licence my library with an open source licence and make sure I only add to it in my own time using my own equipment and therefore making sure that if I use it in a work project the same rules apply as if I was using a third party library. I write in many different languages and often would require two or more parts of this library. Should I look at implementing a few template projects and a core project for each of my chosen reusable components and languages? Has anyone else got this sort of library and how do you organise and update it?

    Read the article

  • Is this method a good aproach to get SQL values from C#?

    - by MadBoy
    I have this little method that i use to get stuff from SQL. I either call it with varSearch = "" or varSearch = "something". I would like to know if having method written this way is best or would it be better to split it into two methods (by overloading), or maybe i could somehow parametrize whole WHERE clausule? private void sqlPobierzKontrahentDaneKlienta(ListView varListView, string varSearch) { varListView.BeginUpdate(); varListView.Items.Clear(); string preparedCommand; if (varSearch == "") { preparedCommand = @" SELECT t1.[KlienciID], CASE WHEN t2.[PodmiotRodzaj] = 'Firma' THEN t2.[PodmiotFirmaNazwa] ELSE t2.[PodmiotOsobaNazwisko] + ' ' + t2.[PodmiotOsobaImie] END AS 'Nazwa' FROM [BazaZarzadzanie].[dbo].[Klienci] t1 INNER JOIN [BazaZarzadzanie].[dbo].[Podmioty] t2 ON t1.[PodmiotID] = t2.[PodmiotID] ORDER BY t1.[KlienciID]"; } else { preparedCommand = @" SELECT t1.[KlienciID], CASE WHEN t2.[PodmiotRodzaj] = 'Firma' THEN t2.[PodmiotFirmaNazwa] ELSE t2.[PodmiotOsobaNazwisko] + ' ' + t2.[PodmiotOsobaImie] END AS 'Nazwa' FROM [BazaZarzadzanie].[dbo].[Klienci] t1 INNER JOIN [BazaZarzadzanie].[dbo].[Podmioty] t2 ON t1.[PodmiotID] = t2.[PodmiotID] WHERE t2.[PodmiotOsobaNazwisko] LIKE @searchValue OR t2.[PodmiotFirmaNazwa] LIKE @searchValue OR t2.[PodmiotOsobaImie] LIKE @searchValue ORDER BY t1.[KlienciID]"; } using (var varConnection = Locale.sqlConnectOneTime(Locale.sqlDataConnectionDetails)) using (SqlCommand sqlQuery = new SqlCommand(preparedCommand, varConnection)) { sqlQuery.Parameters.AddWithValue("@searchValue", "%" + varSearch + "%"); using (SqlDataReader sqlQueryResult = sqlQuery.ExecuteReader()) if (sqlQueryResult != null) { while (sqlQueryResult.Read()) { string varKontrahenciID = sqlQueryResult["KlienciID"].ToString(); string varKontrahent = sqlQueryResult["Nazwa"].ToString(); ListViewItem item = new ListViewItem(varKontrahenciID, 0); item.SubItems.Add(varKontrahent); varListView.Items.AddRange(new[] {item}); } } } varListView.EndUpdate(); }

    Read the article

  • numbers aren't right when reading text file, have to tally up number of 5 letter words and 6 or more

    - by user320950
    i want to do this: reads the words in the file one at a time. (Use a string to do this) Counts three things: how many single-character words are in the file, how many short (2 to 5 characters) words are in the file, and how many long (6 or more characters) words are in the file. HELP HERE im not sure on how about reading file into a string. i know i have to something like this but i dont understand the rest. HELP HERE ifstream infile; //char mystring[6]; //char mystring[20]; int main() { infile.open("file.txt"); if(infile.fail()) { cout << " Error " << endl; } int numb_char=0; char letter; while(!infile.eof()) { infile.get(letter); cout << letter; numb_char++; break; } cout << " the number of characters is :" << numb_char << endl; infile.close(); return 0;

    Read the article

  • Best practice to query data from MS SQL Server in C Sharp?

    - by Bruno
    What is the best way to query data from a MS SQL Server in C Sharp? I know that it is not good practice to have an SQL query in the code. Is the best way to create a stored procedure and call it from C Sharp with parameters? using (var conn = new SqlConnection(connStr)) using (var command = new SqlCommand("StoredProc", conn) { CommandType = CommandType.StoredProcedure }) { conn.Open(); command.ExecuteNonQuery(); conn.Close(); }

    Read the article

  • BizTalk Best Practice Analyzer v1.2 &ndash; BTS 06,06R2 + 09

    - by BizTalk Visionary
    BizTalk Best Practice Analyser is released and available for download. Download: BizTalkBPA V1.2 As always another very handy tool is the Message Box Viewer (Currently V10) which provides some very detailed information as well. Download: Message Box Viewer (MBV) Enjoy your day, Mick. Read the complete post at http://blogs.breezetraining.com.au/mickb/2010/03/31/BizTalkBestPracticeAnalyzerV12BTS0606R209.aspx

    Read the article

  • What a .NET developer should know or practice (know how to do)? [closed]

    - by Olav
    I would like to have a list of basic tasks that .NET developers of different flavors using Visual Studio/SQL Server should be able to do. Ideally with a kind of lab environment where I could practice. VB.NET or C#, latest versions of ASP.NET, WPF and Silverlight. I am looking for small practical "atomic" tasks (like adding a db connection for example) I am looking for some existing labs/lists rather than specific points in the answers. (But I would not mind collaborating in developing material).

    Read the article

  • Is it a good practice to code in English? [closed]

    - by Milox
    Possible Duplicate: Do people in non-English-speaking countries code in English? I have a development comming that is intended to be sold across Latin America (Spanish speakers), but I've heard from some partners that is a good practice to always code in English, I mean just code (methods, classes, pages names, etc), labels on GUI are going to be all in Spanish... Code will be edited in the future by developer of companies across Latin America and just maybe some from outside. What do you think?, any experience with this?

    Read the article

  • Computer Graphics: Principles and Practice in C ( in Python? )

    - by user29163
    I am attending a Computer graphics course after the summer. I have read lots of good things about the book "Computer Graphics: Principles and Practice in C" for people who are willing to put in some work. My school does not focus on C/C++ until next year, so I have decided to learn Python this summer and get good at Python this following year. How language dependent is this book? Can I work through it in Python?

    Read the article

  • Is it good practice to keep 2 related tables (using auto_increment PK) to have the same Max of auto_increment ID when table1 got modified?

    - by Tum
    This question is about good design practice in programming. Let see this example, we have 2 interrelated tables: Table1 textID - text 1 - love.. 2 - men... ... Table2 rID - textID 1 - 1 2 - 2 ... Note: In Table1: textID is auto_increment primary key In Table2: rID is auto_increment primary key & textID is foreign key The relationship is that 1 rID will have 1 and only 1 textID but 1 textID can have a few rID. So, when table1 got modification then table2 should be updated accordingly. Ok, here is a fictitious example. You build a very complicated system. When you modify 1 record in table1, you need to keep track of the related record in table2. To keep track, you can do like this: Option 1: When you modify a record in table1, you will try to modify a related record in table 2. This could be quite hard in term of programming expecially for a very very complicated system. Option 2: instead of modifying a related record in table2, you decided to delete old record in table 2 & insert new one. This is easier for you to program. For example, suppose you are using option2, then when you modify record 1,2,3,....,100 in table1, the table2 will look like this: Table2 rID - textID 101 - 1 102 - 2 ... 200 - 100 This means the Max of auto_increment IDs in table1 is still the same (100) but the Max of auto_increment IDs in table2 already reached 200. what if the user modify many times? if they do then the table2 may run out of records? we can use BigInt but that make the app run slower? Note: If you spend time to program to modify records in table2 when table1 got modified then it will be very hard & thus it will be error prone. But if you just clear the old record & insert new records into table2 then it is much easy to program & thus your program is simpler & less error prone. So, is it good practice to keep 2 related tables (using auto_increment PK) to have the same Max of auto_increment ID when table1 got modified?

    Read the article

  • Best practice for storing HTML coming from text fields to a database?

    - by user1767270
    I have an application that allows users to edit certain parts of text and then email that out. My question is what is the best way to store this in a Microsoft SQL Server database. Right now I have two tables, one holding the HTML data and one holding the plain text data. When the user saves the info, it replaces newlines with br's and puts it in the HTML-conntaining table and then puts the regular text in the other table. This way the text box has the newlines when they go to edit, but the table that contains the HTML data, has the BR's. This seems like a silly way to do things. What would be the best practice? Thanks.

    Read the article

  • What is a best practice tier structure of a Java EE 6/7 application?

    - by James Drinkard
    I was attempting to find a best practice for modeling the tiers in a Java EE application yesterday and couldn't come up with anything current. In the past, say java 1.4, it was four tiers: Presentation Tier Web Tier Business Logic Tier DAL (Data Access Layer ) which I always considered a tier and not a layer. After working with Web Services and SOA I thought to add in a services tier, but that may fall under 3. the business logic tier. I did searches for quite a while and reading articles. It seems like Domain Driven Design is becoming more popular, but I couldn't find a diagram on it's tier structure. Anyone have ideas or diagrams on what the proper tier structure is for newer Java EE applications or is it really the same, but more items are ranked under the four I've mentioned?

    Read the article

  • Using branchs for a mini project or module of project: Good practice?

    - by TheLQ
    In my repo I have 3 closely related mini projects: 1 server and 2 clients. They are all quite small (<3 files each). Since they are so small and so closely related I just dropped them in folders in one single repo. However now that I know I can't clone a single directory in my VCS of choice (Mercurial), I'm considering splitting them up. However I'm confused about general best practice: Is it okay to put different small projects in different branches, or should they all go in different repos? I'm currently leaning towards branching since I can't easily splice out the file history of the different projects but then your using a feature in a way it wasn't meant to be used.

    Read the article

  • Is it good practice to analyse who introduced each bug?

    - by Michal Czardybon
    I used to analyse performance of programmers in my team by looking at the issues they have closed. Many of the issues are of course bugs. And here another important performance aspect comes - who introduced the bugs. I am wondering, if creating a custom field in the issue tracking system "Blamed" for reporting the person who generated the problem, is a good practice. One one hand it seems ok to me to promote personal responsibility for quality and this could reduce the additional work we have due to careless programming. On the other hand this is negative, things are sometimes vague and sometimes there is a reason such us "this thing had to be done very quickly due to a client's...". What to you think?

    Read the article

  • Is listing developer's full names in splash screen or about box still a widely spread and desirable practice?

    - by Pierre 303
    Just like in the closing credits of movies, some software vendors list the full names of the team that worked on the piece of software you are using. They are usually displayed in the splash screen (Photoshop) ... or in the about box (Traktor). In the demoscene, it is a mandatory practice, like in the movie industry. How do you see that in your own software? Is there any reason why not doing it? Is there any reason encouraging companies to do it?

    Read the article

  • Is having a class have a handleAction(type) method bad practice?

    - by zhenka
    My web application became a little too complicated to do everything in a controller so I had to build large wrapper classes for ORM models. The possible actions a user can trigger are all similar and after a certain point I realized that the best way to go would be to just have constructor method receive action type as a parameter to take care of the small differences internally, as opposed to either passing many arguments or doing a lot of things in the controller. Is this a good practice? I can't really give details for privacy issues.

    Read the article

  • Having a generic data type for a database table column, is it "good" practice?

    - by Yanick Rochon
    I'm working on a PHP project where some object (class member) may contain different data type. For example : class Property { private $_id; // (PK) private $_ref_id; // the object reference id (FK) private $_name; // the name of the property private $_type; // 'string', 'int', 'float(n,m)', 'datetime', etc. private $_data; // ... // ..snip.. public getters/setters } Now, I need to perform some persistence on these objects. Some properties may be a text data type, but nothing bigger than what a varchar may hold. Also, later on, I need to be able to perform searches and sorting. Is it a good practice to use a single database table for this (ie. is there a non negligible performance impact)? If it's "acceptable", then what could be the data type for the data column?

    Read the article

  • Using branches for a mini project or module of project: Good practice?

    - by TheLQ
    In my repo I have 3 closely related mini projects: 1 server and 2 clients. They are all quite small (<3 files each). Since they are so small and so closely related I just dropped them in folders in one single repo. However now that I know I can't clone a single directory in my VCS of choice (Mercurial), I'm considering splitting them up. However I'm confused about general best practice: Is it okay to put different small projects in different branches, or should they all go in different repos? I'm currently leaning towards branching since I can't easily splice out the file history of the different projects but then your using a feature in a way it wasn't meant to be used.

    Read the article

  • Declaring interface in the same file as the base class, is it a good practice?

    - by Louis Rhys
    To be interchangable and testable, normally services with logic needs to have interface, e.g. public class FooService: IFooService { ... } Design-wise, I agree with this, but one of the things that bothers me with this approach is that for one service you will need to declare two things (the class and the interface), and in our team, normally two files (one for the class and one for the interface). Another discomfort is the difficulty in navigation because using "Go to definition" in IDE (VS2010) will point to the interface (since other classes refer to the interface), not the actual class. I was thinking that writing IFooService in the same file as FooService will reduce the above weirdness. After all, IFooService and FooService are very related. Is this a good practice? Is there a good reason that IFooService must be located in its own file?

    Read the article

  • Of which bad practice is require calling functions in order a sign?

    - by stijn
    Sometimes I find myself writing comments on class methods like this: class A : public Base { public: /** * Sets variable; * should be called before ImplementsInterfaceMtehod(), * else has no effect. */ void SetSomeVariable( var_type value ); virtual void ImplementsInterfaceMethod(); } The callers of Base::ImplementsInterfaceMethod obviously do not know about the variable, and should not. But the users of A should set the variable if they want it to take effect. It is not required to set the variable (else it could be a parameter for the constructor), so I cannot throw exceptions in ImplementsInterfaceMethod if it is not set. Is this a sign of some typical bad practice? Is there a better way than writing a comment as shown to deal with this?

    Read the article

  • Is it bad practice to call a controller action from a view that was rendered by another controller?

    - by marco-fiset
    Let's say I have an OrderController which handles orders. The user adds products to it through the view, and then the final price gets calculated through an AJAX call to a controller action. The price calculation logic is implemented in a seperate class and used in a controller action. What happens is that I have many views from different controllers that need to use that particular action. I'd like to have some kind of a PriceController that I could call an action on. But then the view would have to know about that PriceController and call an action on it. Is it bad practice for a view to call an action on a different controller from which it was rendered?

    Read the article

  • Is it bad practice to use the same name for arguments and members?

    - by stijn
    Sometimes I write constructor code like class X { public: X( const int numberOfThingsToDo ) : numberOfThingsToDo( numberOfThingsToDo ) { } private: int numberOfThingsToDo; }; or in C# class X { public X( int numberOfThingsToDo ) { this.numberOfThingsToDo = numberOfThingsToDo; } private int numberOfThingsToDo; } I think the main reason is that when I come up with a suitable member name, I see no reason to use a different one for the argument initializing it, and since I'm also no fan of using underscores the easiest is just to pick the same name. After all it's suitable. Is this considered bad practice however? Any drawbacks (apart from shooting yourself in the foot when forgetting the this in C#)?

    Read the article

  • Is it a good practice to use smaller data types for variables to save memory?

    - by ThePlan
    When I learned the C++ language for the first time I learned that besides int, float etc, smaller or bigger versions of these data types existed within the language. For example I could call a variable x int x; or short int x; The main difference being that short int takes 2 bytes of memory while int takes 4 bytes, and short int has a lesser value, but we could also call this to make it even smaller: int x; short int x; unsigned short int x; which is even more restrictive. My question here is if it's a good practice to use separate data types according to what values your variable take within the program. Is it a good idea to always declare variables according to these data types?

    Read the article

  • Is it Considered Good SQL practice to use GUID to link multiple tables to same Id field?

    - by Mallow
    I want to link several tables to a many-to-many(m2m) table. One table would be called location and this table would always be on one side of the m2m table. But I will have a list of several tables for example: Cards Photographs Illustrations Vectors Would using GUID's between these tables to link it to a single column in another table be considered 'Good Practice'? Will Mysql let me to have it automatically cascade updates and delete? If so, would multiple cascades lead to an issues? UPDATE I've read that GUID (a hex number) Generally takes up more space in a database and slows queries down. However I could still generate 'unique' ids by just having the table initial's as part of the id so that the table card's id would be c0001, and then Illustrations be I001. Regardless of this change, the questions still stands.

    Read the article

  • Images from remote source - is it possible or is it bad practice?

    - by user1620696
    I'm building a management system for websites and I had an idea related to image galleries. I'm not sure it's a good approach. Since image space needed is related to how many images a user might upload, I thought about using cloud services like DropBox, Mega, and Google Drive to store images and load then when needed. The obvious problem with this approach is that downloading the images from the 3rd party service would hamper the user experience due to the increased download times. Is there any way to save images belonging in an image gallery on remote source without hampering the user experience because of speed? Or is this approach really not a good practice?

    Read the article

  • bad practice to create a print friendly page to remove the use of pdfs?

    - by Phil
    the company I work for has a one page invoice that uses the library tcpdf. they wanted to do some design changes that I found are just incredibly difficult for setting up in .pdf format. using html/css I could easily create the page and have it print very nicely, but I have a feeling that I am over looking something. is it a good practice to set up a page just for printing? and if not, is it at least better than putting out a ugly .pdf? I could also use the CSS inline so that if they wanted to download it and open it they could.

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >