Daily Archives

Articles indexed Friday April 23 2010

Page 1/115 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to mount a drive in Ubuntu from terminal

    - by Mirage
    hi, I want to mount a drive from terminal at start up. At start if i use ls /media then its empty but if i go to computer and then click VM drive there and after that i use ls /media then it shows VM drive . How can i mount that drive at from terminal something like mount VM or how can find the path of VM like /dev/sda or something

    Read the article

  • How to manage maintenance/bug-fix branches in Subversion when setup projects need to be built?

    - by Mike Spross
    We have a suite of related products written in VB6, with some C# and VB.NET projects, and all the source is kept in a single Subversion repository. We haven't been using branches in Subversion (although we do tag releases now), and simply do all development in trunk, creating new releases when the trunk is stable enough. This causes no end of grief when we release a new version, issues are found with it, and we have already begun working on new features or major changes to the trunk. In the past, we would address this in one of two ways, depending on the severity of the issues and how stable we thought the trunk was: Hurry to stabilize the trunk, fix the issues, and then release a maintenance update based on the HEAD revision, but this had the side effect of releases that fixed the bugs but introduced new issues because of half-finished features or bugfixes that were in trunk. Make customers wait until the next official release, which is usually a few months. We want to change our policies to better deal with this situation. I was considering creating a "maintenance branch" in Subversion whenever I tag an official release. Then, new development would continue in trunk, and I can periodically merge specific fixes from trunk into the maintenance branch, and create a maintenance release when enough fixes are accumulated, while we continue to work on the next major update in parallel. I know we could also have a more stable trunk and create a branch for new updates instead, but keeping current development in trunk seems simpler to me. The major problem is that while we can easily branch the source code from a release tag and recompile it to get the binaries for that release, I'm not sure how to handle the setup and installer projects. We use QSetup to create all of our setup programs, and right now when we need to modify a setup project, we just edit the project file in-place (all the setup projects and any dependencies that we don't compile ourselves are stored on a separate server, and we make sure to always compile the setup projects on that machine only). However, since we may add or remove files to the setup as our code changes, there is no guarantee that today's setup projects will work with yesterday's source code. I was going to put all the QSetup projects in Subversion to deal with this, but I see some problems with this approach. I want the creation of setup programs to be as automated as possible, and at the very least, I want a separate build machine where I can build the release that I want (grabbing the code from Subversion first), grab the setup project for that release from Subversion, recompile the setup, and then copy the setup to another place on the network for QA testing and eventual release to customers. However, when someone needs to change a setup project (to add a new dependency that trunk now requires or to make other changes), there is a problem. If they treat it like a source file and check it out on their own machine to edit it, they won't be able to add files to the project unless they first copy the files they need to add to the build machine (so they are available to other developers), then copy all the other dependencies from the build machine to their machine, making sure to match the folder structure exactly. The issue here is that QSetup uses absolute paths for any files added to a setup project. However, this means installing a bunch of setup dependencies onto development machines, which seems messy (and which could destabilize the development environment if someone accidentally runs the setup project on their machine). Also, how do we manage third-party dependencies? For example, if the current maintenance branch used MSXML 3.0 and the trunk now requires MSXML 4.0, we can't go back and create a maintenance release if we have already replaced the MSXML library on the build machine with the latest version (assuming both versions have the same filename). The only solution I can think is to either put all the third-party dependencies in Subversion along with the source code, or to make sure we put different library versions in separate folders (i.e. C:\Setup\Dependencies\MSXML\v3.0 and C:\Setup\Dependencies\MSXML\v4.0). Is one way "better" or more common than the other? Are there any best practices for dealing with this situation? Basically, if we release v2.0 of our software, we want to be able to release v2.0.1, v2.0.2, and v.2.0.3 while we work on v2.1, but the whole setup/installation project and setup dependency issue is making this more complicated than the typical "just create a branch in Subversion and recompile as needed" answer.

    Read the article

  • Another design-related C++ question

    - by Kotti
    Hi! I am trying to find some optimal solutions in C++ coding patterns, and this is one of my game engine - related questions. Take a look at the game object declaration (I removed almost everything, that has no connection with the question). // Abstract representation of a game object class Object : public Entity, IRenderable, ISerializable { // Object parameters // Other not really important stuff public: // @note Rendering template will never change while // the object 'lives' Object(RenderTemplate& render_template, /* params */) : /*...*/ { } private: // Object rendering template RenderTemplate render_template; public: /** * Default object render method * Draws rendering template data at (X, Y) with (Width, Height) dimensions * * @note If no appropriate rendering method overload is specified * for any derived class, this method is called * * @param Backend & b * @return void * @see */ virtual void Render(Backend& backend) const { // Render sprite from object's // rendering template structure backend.RenderFromTemplate( render_template, x, y, width, height ); } }; Here is also the IRenderable interface declaration: // Objects that can be rendered interface IRenderable { /** * Abstract method to render current object * * @param Backend & b * @return void * @see */ virtual void Render(Backend& b) const = 0; } and a sample of a real object that is derived from Object (with severe simplifications :) // Ball object class Ball : public Object { // Ball params public: virtual void Render(Backend& b) const { b.RenderEllipse(/*params*/); } }; What I wanted to get is the ability to have some sort of standard function, that would draw sprite for an object (this is Object::Render) if there is no appropriate overload. So, one can have objects without Render(...) method, and if you try to render them, this default sprite-rendering stuff is invoked. And, one can have specialized objects, that define their own way of being rendered. I think, this way of doing things is quite good, but what I can't figure out - is there any way to split the objects' "normal" methods (like Resize(...) or Rotate(...)) implementation from their rendering implementation? Because if everything is done the way described earlier, a common .cpp file, that implements any type of object would generally mix the Resize(...), etc methods implementation and this virtual Render(...) method and this seems to be a mess. I actually want to have rendering procedures for the objects in one place and their "logic implementation" - in another. Is there a way this can be done (maybe alternative pattern or trick or hint) or this is where all this polymorphic and virtual stuff sucks in terms of code placement?

    Read the article

  • Windows "known folders": is there any one of them which is reliably read/write for all users on all

    - by Stabledog
    SHGetKnownFolderPath() and its cohorts accept one of the constants defined here (http://msdn.microsoft.com/en-us/library/dd378457%28v=VS.85%29.aspx ), returning the path to a directory. I'm looking for one of these folders which is reliably writable by all users (including LocalSystem) on XP, Vista, and Windows 7... but I think I'm striking out. It appears that, in fact, there is no single location on the hard drive anymore where you can put a file and be assured that all users can write to it on all these OS versions, without fiddling the permissions first. Is this true?

    Read the article

  • Print the first line of a file

    - by Pedro
    void cabclh(){ FILE *fp; char *val, aux; int i=0; char *result, cabeca[60]; fp=fopen("trabalho.txt","r"); if(fp==NULL){ printf("Erro ao abrir o ficheiro\n"); return ; } val=(char*)calloc(aux, sizeof(char)); while(fgetc(fp)=='\n'){ fgets(cabeca,60,fp); printf("%s\n",cabeca); } fclose(fp); free(fp); } void infos(){ FILE *fp; char info[100]; fp=fopen("trabalho.txt","r"); if(fp==NULL){ printf("Erro ao abrir o ficheiro\n"); } while(fgetc(fp)=='-'){ fgets(info,100,fp); printf("%s\n",info); } fclose(fp); } At cabclh i want that the program recognize that the first line is header..but this code doesn't print nothing At infos i want that he recognize that every lines that begin with '-' are info...

    Read the article

  • Coerce Windows to show a thumbnail for my custom file type.

    - by Jakob Ryden
    Hi, I want to use the windows OpenFileDialog class in C# to browse files for my application. I would then like the files to show up with previews in Windows' "thumbnails" view. Is there a simple way to make this happen? I'm thinking there should be a way to encode the files so that Windows simply reads and displays the thumbnail information, even though it's an unsupported file type? I know Windows Vista has a different interface (IThumbnailProvider as opposed to IExtractImage) than Windows XP, but I need it to work across platforms. Thanks! / Jakob

    Read the article

  • Always use multiple cores (/MP) flag with Visual Studio?

    - by dwj
    I'm using Visual Studio 2008 on my main build system. I've been playing with Visual Studio 2010 on another one. It appears that the tool still only wants to use one core when compiling unless you specify the /MP switch in the compiler switches (see http://stackoverflow.com/questions/1422601/how-do-i-turn-on-multi-cpu-core-c-compiles-in-the-visual-studio-ide-2008). I have to do this for every project. Is there a way to make VS always do this?

    Read the article

  • jQuery post to another controller

    - by griegs
    If I have a Controller called "HomeController" and I'm on the Index page of that controller, how can I do a jQuery Ajax post to another controller. I tried the below, $.post("/DetailedQuote/jQueryGetDetailedQuote", { productCode: "LPJ" }, function(newHTML) { alert(88); }); I have a DetailedQuoteController. I have also tried; post("DetailedQuote/ post("DetailedQuote.aspx/ post("/DetailedQuote.aspx/ post("/DetailedQuoteController/ post("DetailedQuoteController/ post("DetailedQuoteController.aspx/ post("/DetailedQuoteController.aspx/ And still no joy. I should also mention that this is running a Hybrid WebForms and MVC site on IIS 6.

    Read the article

  • From Java GUI to Java Web

    - by Xorty
    I've been doing quite large application recently with Java - Swing. Now I'd like to move to web. Basically - I am not Microsoft guy, Java is fine with me. I've checked some basics of Java EE framework and decided that my choice will be Spring. I already am familiar with JDBC. Learning Spring is one thing, but working just with GUIs (C++ and Java) means that I have very poor knowledge of web development. Before I start reading tutorials of Spring MVC, what should I know to develop web solutions? I am mainly interested "how to" with graphics ... start from scratch or some nice IDE RAD-like development ? I kind of like f.e. Silverlight and integrating to web or asp.net win forms - allows us 'GUI' people develop faster. So can you please give me some useful advices? Thanx

    Read the article

  • How to handle payment types with varying properties in the most elegant way.

    - by Byron Sommardahl
    I'm using ASP.NET MVC 2. Keeping it simple, I have three payment types: credit card, e-check, or "bill me later". I want to: choose one payment type display some fields for one payment type in my view run some logic using those fields (specific to the type) display a confirmation view run some more logic using those fields (specific to the type) display a receipt view Each payment type has fields specific to the type... maybe 2 fields, maybe more. For now, I know how many and what fields, but more could be added. I believe the best thing for my views is to have a partial view per payment type to handle the different fields and let the controller decide which partial to render (if you have a better option, I'm open). My real problem comes from the logic that happens in the controller between views. Each payment type has a variable number of fields. I'd like to keep everything strongly typed, but it feels like some sort of dictionary is the only option. Add to that specific logic that runs depending on the payment type. In an effort to keep things strongly typed, I've created a class for each payment type. No interface or inherited type since the fields are different per payment type. Then, I've got a Submit() method for each payment type. Then, while the controller is deciding which partial view to display, it also assigns the target of the submit action. This is not elegant solution and feels very wrong. I'm reaching out for a hand. How would you do this?

    Read the article

  • ASP.Net application can no longer write to DB after having run out of disk space

    - by remi.despres-smyth
    I'm a software developer troubleshooting a sticky problem on a client's production server, and I've got a bit of a problem. They have a virtual server running Windows Server 2008, SQL Server 2008 R1 and IIS7. It was provisioned with two partitions: one that has the OS (~15 Gig), and the other has IIS' web sites (another ~15 Gig). My application that's running this server has been running perfectly well, up until about an hour ago, when it started throwing System.IO.IOException: "There is not enough space on disk". As soon as my client notified me, I cleared up some space on C:\, emptied the recycle bin, and restarted SQL Server and IIS. The web server came back up and the application was running, but it no longer saves information to the database. No error message is coming up, the application can get information out of the DB, but it can no longer save data back to it. I rebooted the server, to no effect. I spoke with a sys admin at the hosting company, and he says SQL Server appears to have come up fine and the database is not in read-only mode. I confirmed that, as I can add records to tables from SQL Server Management Studio. I looked at the event log immediately after trying to save an edited record in the app, and no new events appear in there that I can tell. I'm assuming this is related to having run out of space, as it was all working fine prior to that, but I'm at a bit of a loss as to what exactly needs a kick in the pants to get going again. Can anyone help me out? What the heck is going on here?

    Read the article

  • Drupal with clean urls turned on is putting question marks in URL

    - by aussiegeek
    I have a drupal site with clean urls, the pages load correctly, but then the URL is rewritten with a question mark in it, which I don't want the user to see. My .htaccess is: <IfModule mod_rewrite.c> RewriteEngine on # If your site can be accessed both with and without the 'www.' prefix, you # can use one of the following settings to redirect users to your preferred # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: # # To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example.com/...) # adapt and uncomment the following: # RewriteCond %{HTTP_HOST} ^example\.com$ [NC] # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] # # To redirect all users to access the site WITHOUT the 'www.' prefix, # (http://www.example.com/... will be redirected to http://example.com/...) # uncomment and adapt the following: # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] # Modify the RewriteBase if you are using Drupal in a subdirectory or in a # VirtualDocumentRoot and the rewrite rules are not working properly. # For example if your site is at http://example.com/drupal uncomment and # modify the following line: # RewriteBase /drupal # # If your site is running in a VirtualDocumentRoot at http://example.com/, # uncomment the following line: RewriteBase / # Rewrite URLs of the form 'x' to the form 'index.php?q=x'. RewriteCond %{REQUEST_URI} !(connect|administration) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] </IfModule>

    Read the article

  • Basic C++ Header File Question

    - by Vsh3r
    Hi, I have a project with two header files mainwindow.h and website.h. I want to access a method from website.cpp from inside mainwindow.cpp. I can access any function from inside mainwindow by doing Window w then doing w-function(); However, when the function finishes from inside the mainwindow the memory for w is erased. How do I keep w around and HOW DO I DECLARE Website w from my header file? Thanks, V$h3r

    Read the article

  • Bluetooth on 2.0+

    - by awiden
    I'm doing bluetooth development for connecting with a PC. I've basicly used the BTChatExample and changed the UUID to the standard PC SPP-profile. Trying to close a bluetooth application during a blocking read, by closing the BluetoothSocket will leave the Bluetooth stack in a unusable state. This can only be fixed by disabling and enabling bluetooth and restarting the application. Checking logcat, you can see that some of the internal methods are failing, leaving a open port. Any information on this? First of all there seams to be differences on how bluetooth is implemented on N1 and HTC Legend/Desire both running 2.1, do you know anything about this? Connecting isn't 100% reliable, sometimes I get a warning saying ~PortSystemContext init: FAILED. This leaves bluetooth unusable, and restarting is needed. Am I right in assuming that SPP is the only profile supported for use with the APIs? That's what the docs on the BluetoothAdapter says. I would love to discuss issues on bluetooth with a developer and iron out these bugs so that Android can have good proper BT support it deserves.

    Read the article

  • Silly c# array question

    - by XO
    Element 0 value: TimeEntries[0] = "False,S,16:00,21:00"; Element 0 is assigned to: timeLine = USER.TimeEntries[i]; I want to perform a .Split() on timeLine but it must be a string. What's the easiest way to go about this? Thanks

    Read the article

  • Taking a snapshot (cloning) of a project using Linq 2 Sql

    - by JoeBlogs1999
    I have a Project entity with several child tables, eg ProjectAwards ProjectTeamMember I would like to copy the data from Project (and child tables) into a new Project record and update the Project status. eg var projectEntity = getProjectEntity(projectId); draftProjectEntity = projectEntity draftProjectEntity.Status = NewStatus context.SubmitChanges(); I found this link from Marc Gravell Its part of the way there but it updates the child records to the new draftProject, where I need it to copy.

    Read the article

  • Can you access registers from python functions in vim

    - by Michael Anderson
    It seems vims python sripting is designed to edit buffer and files rather than work nicely with vims registers. You can use some of the vim packages commands to get access to the registers but its not pretty. My solution for creating a vim function using python that uses a register is something like this. function printUnnamedRegister() python >> EOF print vim.eval('@@') EOF Setting registers may also be possible using something like function setUnnamedRegsiter() python >> EOF s = "Some \"crazy\" string\nwith interesting characters" vim.command('let @@="%s"' % myescapefn(s) ) EOF However this feels a bit cumbersome and I'm not sure exactly what myescapefn should be. So I've never been able to get the setting version to work properly. So if there's a way to do something more like function printUnnamedRegister() python >> EOF print vim.getRegister('@') EOF function setUnnamedRegsiter() python >> EOF s = "Some \"crazy\" string\nwith interesting characters" vim.setRegister('@',s) EOF Or even a nice version of myescapefn I could use then that would be very handy.

    Read the article

  • How to convert strings into integers in python?

    - by elfuego1
    Hello there, I have a tuple of tuples from MySQL query like this: T1 = (('13', '17', '18', '21', '32'), ('07', '11', '13', '14', '28'), ('01', '05', '06', '08', '15', '16')) I'd like to convert all the string elements into integers and put it back nicely to list of lists this time: T2 = [[13, 17, 18, 21, 32], [7, 11, 13, 14, 28], [1, 5, 6, 8, 15, 16]] I tried to achieve it with "eval" but didn't get any decent result yet.

    Read the article

  • Ruby on Rails: having two xmlbuilder templates per action , one for errors one for regular output

    - by randombits
    What's the best way to handle having two templates (or should it be one, DRY?) for xml builder templates? I'm building a web api with Rails and wanted to see an example of how to have a view that does regular output vs one that does error output. I've been using @obj.to_xml for a while, but my requirements have changed and require me building my own error templates. do you typically have both views in one with a condition above for errors such as app/views/myresource/create.xml.builder unless @myobj.errors.empty? // xml for errors here? end // regular xml view

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >