Search Results

Search found 13430 results on 538 pages for 'easy'.

Page 79/538 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • More elegant way to avoid hard coding the format of a a CSV file?

    - by dsollen
    I know this is trivial issue, but I just feel this can be more elegant. So I need to write/read data files for my program, lets say they are CSV for now. I can implement the format as I see fit, but I may have need to change that format later. The simply thing to do is something like out.write(For.getValue()+","+bar.getMinValue()+","+fi.toString()); This is easy to write, but obviously is guilty of hard coding and the general 'magic number' issue. The format is hard-coded, requires parsing of the code to figure out the file format, and changing the format requires changing multiple methods. I could instead have my constants specifying the location that I want each variable to be saved in the CSV file to remove some of the 'magic numbers'; then save/load into the an array at the location specified by the constants: int FOO_LOCATION=0; int BAR_MIN_VAL_LOCATION=1; int FI_LOCATION=2 int NUM_ARGUMENTS=3; String[] outputArguments=new String[NUM_ARGUMENTS]; outputArguments[FOO_LOCATION] = foo.getValue(); outputArgumetns[BAR_MIN_VAL_LOCATION] = bar.getMinValue(); outptArguments[FI_LOCATOIN==fi.toString(); writeAsCSV(outputArguments); But this is...extremely verbose and still a bit ugly. It makes it easy to see the format of existing CSV and to swap the location of variables within the file easily. However, if I decide to add an extra value to the csv I need to not only add a new constant, but also modify the read and write methods to add the logic that actually saves/reads the argument from the array; I still have to hunt down every method using these variables and change them by hand! If I use Java enums I can clean this up slightly, but the real issue is still present. Short of some sort of functional programming (and java's inner classes are too ugly to be considered functional) I still have no obvious way of clearly expressing what variable is associated with each constant short of writing (and maintaining) it in the read/write methods. For instance I still need to write somewhere that the FOO_LOCATION specifies the location of foo.getValue(). It seems as if there should be a prettier, easier to maintain, manner for approaching this? Incidentally, I'm working in java at the moment, however, I am interested conceptually about the design approach regardless of language. Some library in java that does all the work for me is definitely welcome (though it may prove more hassle to get permission to add it to the codebase then to just write something by hand quickly), but what I'm really asking is more about how to write elegant code if you had to do this by hand.

    Read the article

  • How to Improve Your Search Engine Ranking by Making "How To" Articles

    Every day, multitudes of people are connecting to the internet and searching for information. The Internet is well known for holding tons of knowledge and information from all over the world. One major way that people are getting their information is by searching for "How To" articles. When someone needs to know how to build a birdhouse for instance, it is quick and easy to go to their favorite search engine and simply type "how to build a birdhouse".

    Read the article

  • Ubuntu take hours to start!

    - by y2b4u3d
    I have installed Ubuntu 11.10 as my only OS after I formatted Windows XP but after the installation finished it took four hours to boot and start working it just was stuck in that purple screen with nothing on it!!! But if I unplug the power and start my PC again it start after bring me the grub option... What should I do to make em start just as easy as any OS do! my RAM is 1 GB, 80GB HDD, ASROCK.

    Read the article

  • The Benefits of Website Creation Software

    Building your own website can be time consuming and costly if you are not technically inclined. But building one or more websites using site building software is the easy, quick and efficient way to do it for quicker profits.

    Read the article

  • SEO Tips - Avoiding 3 Common Mistakes

    Some of the most effective SEO tips are also some of the easiest to implement and are often overlooked. An effectively optimized site can increase the amount of free and targeted search engine traffic you receive. Read on to see 3 search engine optimization tips that are easy to follow and will result in more free traffic to your site.

    Read the article

  • How to Stream Videos and Music Over the Network Using VLC

    - by Chris Hoffman
    VLC includes a fairly easy-to-use streaming feature that can stream music and videos over a local network or the Internet. You can tune into the stream using VLC or other media players. Use VLC’s web interface as a remote control to control the stream from elsewhere. Bear in mind that you may not have the bandwidth to stream high-definition videos over the Internet, though. How to Use an Xbox 360 Controller On Your Windows PC Download the Official How-To Geek Trivia App for Windows 8 How to Banish Duplicate Photos with VisiPic

    Read the article

  • Bordeaux on PC-BSD Screenshot tour

    <b>Wine-Reviews:</b> "This is a Bordeaux on PC-BSD 8 Screenshot tour. This tour will show you how easy it is to install Bordeaux on PC-BSD and start installing Windows Applications and Games. Bordeaux has a single dependency on Zenity once Zenity is installed"

    Read the article

  • Tricky situation with EF and Include while projecting (Select / SelectMany)

    - by Vincent Grondin
    Originally posted on: http://geekswithblogs.net/vincentgrondin/archive/2014/06/07/tricky-situation-with-ef-and-include-while-projecting-select.aspxHello, the other day I stumbled on a problem I had a while back with EF and Include method calls and decided this was it and I was going to blog about it…  This would sort of to pin it inside my head and maybe help others too !  So I was using DBContext and wanted to query a DBSet and include some of it’s associations and in the end, do a projection to get a list of Ids…   At first it seems easy…  Query your DBSet, call Include right afterward, then code the rest of your statement with the appropriate where clause and then, do the projection…   Well it wasn’t that easy as my query required I code my where on some entities a few degree further in the association chain and most of these links where “Many”…  I had to do my projection right away with the SelectMany method.  So I did my stuff and tested the query….  no association where loaded…  My Include statement was simply ignored !  Then I remembered this behavior and how to get it to work…  You need to move the Include AFTER your first projection (Select or SelectMany).  So my sequence became:   Query the DBSet, do the projection with SelectMany, Include the associations, code the where clause and do the final projection…. but it wouldn’t compile…   It kept saying that it could not find an “Include” method on an IQueryable… which is perfectly true!  I knew this should work so I went to the definition of the DBset and saw it inherited DBQuery and sure enough the include method was there…  So I had to cast my statement from start until the end of the first projection in a DBQuery then do the Includes and then the rest of my query….   Bottom line is, whenever your Include statement seem to be ignored, then maybe you will need to move them further down in your query and cast your statement in whatever class gives you access to the Include…   Happy coding all !

    Read the article

  • Video Blogging in Wordpress

    <b>Packt:</b> "Video is a major component of the Web today. Luckily, WordPress makes it easy to publish and share video. In this article, we will demonstrate ways of working with video in WordPress and in Flash."

    Read the article

  • Make Extra Money Online - Create Your Free Site

    Now that you have a Google Account and have discovered what you can do with Google Sites, it's time to dig in and start exploring. It is easy to use. If you've ever used a word processor, you already know the basics to making the most of Internet Pages.

    Read the article

  • World Backup Day

    This Saturday is World Backup Day, and with this in mind, Red Gate's Brian Harris talks about SQL Backup 7 and why they want to make backup verification a focus for more DBAs. What are your servers really trying to tell you? Find out with new SQL Monitor 3.0, an easy-to-use tool built for no-nonsense database professionals.For effortless insights into SQL Server, download a free trial today.

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >