Search Results

Search found 26214 results on 1049 pages for 'farm solution'.

Page 84/1049 | < Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >

  • Simple Java calculator

    - by Kevin Duke
    Firstly this is not a homework question. I am practicing my knowledge on java. I figured a good way to do this is to write a simple program without help. Unfortunately, my compiler is telling me errors I don't know how to fix. Without changing much logic and code, could someone kindly point out where some of my errors are? Thanks import java.lang.*; import java.util.*; public class Calculator { private int solution; private int x; private int y; private char operators; public Calculator() { solution = 0; Scanner operators = new Scanner(System.in); Scanner operands = new Scanner(System.in); } public int addition(int x, int y) { return x + y; } public int subtraction(int x, int y) { return x - y; } public int multiplication(int x, int y) { return x * y; } public int division(int x, int y) { solution = x / y; return solution; } public void main (String[] args) { System.out.println("What operation? ('+', '-', '*', '/')"); System.out.println("Insert 2 numbers to be subtracted"); System.out.println("operand 1: "); x = operands; System.out.println("operand 2: "); y = operands.next(); switch(operators) { case('+'): addition(operands); operands.next(); break; case('-'): subtraction(operands); operands.next(); break; case('*'): multiplication(operands); operands.next(); break; case('/'): division(operands); operands.next(); break; } } }

    Read the article

  • I need an abstract field !

    - by Jules Olléon
    I know abstract fields do not exist in java. I also read this question but the solutions proposed won't solve my problem. Maybe there is no solution, but it's worth asking :) Problem I have an abstract class that does an operation in the constructor depending on the value of one of its fields. The problem is that the value of this field will change depending on the subclass. How can I do so that the operation is done on the value of the field redefined by the subclass ? If I just "override" the field in the subclass the operation is done on the value of the field in the abstract class. I'm open to any solution that would ensure that the operation will be done during the instantiation of the subclass (ie putting the operation in a method called by each subclass in the constructor is not a valid solution, because someone might extend the abstract class and forget to call the method). Also, I don't want to give the value of the field as an argument of the constructor. Is there any solution to do that, or should I just change my design ?

    Read the article

  • Automatically add links to class source files under a specified directory of another project in Visu

    - by Binary255
    I want to share some class source files between two projects in Visual Studio 2008. I can't create a project for the common parts and reference it (see my comment if you are curious to why). I've managed to share some source files, but it could be a lot more neat. I've created a test solution called Commonality. The Solution Explorer of the Commonality solution which contains project One and Two: What I like: All class files under the Common folder of project One are automatically added to project Two by linking. It's mostly the same as if I would have chosen Add / Existing Item... : Add As Link on each new class source file. It's clear that these files have been linked in. The shortcut arrow symbol is marking each file icon. What I do not like: The file and folder tree structure under Common of project One isn't included. It's all flat. The linked source files are shown under the project root of project Two. It would look much less cluttered if they were located under Common like in project One. The file tree structure of the Commonality solution which contains project One and Two: $ tree /F /A Folder PATH listing for volume Cystem Volume serial number is 0713370 1337:F6A4 C:. | Commonality.sln | +---One | | One.cs | | One.csproj | | | +---bin | | \---Debug | | One.vshost.exe | | One.vshost.exe.manifest | | | +---Common | | | Common.cs | | | CommonTwo.cs | | | | | \---SubCommon | | CommonThree.cs | | | +---obj | | \---Debug | | +---Refactor | | \---TempPE | \---Properties | AssemblyInfo.cs | \---Two | Two.cs | Two.csproj | Two.csproj.user | Two.csproj~ | +---bin | \---Debug +---obj | \---Debug | +---Refactor | \---TempPE \---Properties AssemblyInfo.cs And the relevant part of project Two's project file Two.csproj: <ItemGroup> <Compile Include="..\One\Common\**\*.cs"> </Compile> <Compile Include="Two.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> How do I address what I do not like, while keeping what I like?

    Read the article

  • Capture *all* display-characters in JavaScript?

    - by Jean-Charles
    I was given an unusual request recently that I'm having the most difficult time addressing that involves capturing all display-characters when typed into a text box. The set up is as follows: I have a text box that has a maxlength of 10 characters. When the user attempts to type more than 10 characters, I need to notify the user that they're typing beyond the character count limit. The simplest solution would be to specify a maxlength of 11, test the length on every keyup, and truncate back down to 10 characters but this solution seems a bit kludgy. What I'd prefer to do is capture the character before keyup and, depending on whether or not it is a display-character, present the notification to the user and prevent the default action. A white-list would be challenging since we handle a lot of international data. I've played around with every combination of keydown, keypress, and keyup, reading event.keyCode, event.charCode, and event.which, but I can't find a single combination that works across all browsers. The best I could manage is the following that works properly in =IE6, Chrome5, FF3.6, but fails in Opera: NOTE: The following code utilizes jQuery. $(function(){ $('#textbox').keypress(function(e){ var $this = $(this); var key = ('undefined'==typeof e.which?e.keyCode:e.which); if ($this.val().length==($this.attr('maxlength')||10)) { switch(key){ case 13: //return case 9: //tab case 27: //escape case 8: //backspace case 0: //other non-alphanumeric break; default: alert('no - '+e.charCode+' - '+e.which+' - '+e.keyCode); return false; }; } }); }); I'll grant that what I'm doing is likely over-engineering the solution but now that I'm invested in it, I'd like to know of a solution. Thanks for your help!

    Read the article

  • How to form submit and show a different page in ASP.Net MVC?

    - by melaos
    hi guys i'm new to asp.net mvc.. so basically i just build up a two page app which takes the registration information of the user and post it to the database. i use a lot of jquery and ajax calls to retrieve data from the database using linq to sql stored proc object. and currently i'm stuck at one page where after the user submits the form it should redirect him to /Home/AddProduct. What i found was the error: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. what used on my form are basically a combination of html controls, asp.net controls and some asp.net mvc type controls. i submit the form using action="/Home/ProductAdded" and after doing some googling i found i was supposed to add in the machine key but after doing so, the index page becomes unviewable. because it couldn't find the index file now. removing the action helps, but now it just doesn't go anywhere. so what am i missing here? i feel i'm missing a lot of fundamentals understanding about asp.net mvc and i don't even know how to submit a form and go to a different page here!!

    Read the article

  • Problems referencing build output from TFS Build and Visual Studio

    - by pmdarrow
    Here's what I'm trying to do: I have two solutions - one for my main application and its associated projects and another for my database (VS .dbproj) and its associated projects. What I'd like to do is include the output from the database project (a .dbschema and some SQL scripts) in my WiX installer (which exists in the main application solution.) This involves having TFS build the DB solution immediately before the main application solution. I've got that part working properly, but I'm having trouble referencing the output of the DB solution from my installer. I'm using relative paths to reference the DB project output in my WiX installer (e.g. <?define DBProjectOutputDir = "..\..\MyDatabaseSolution\MyDatabaseProject\sql\"?>) which works fine locally, but fails when building via TFS build. This is because TFS Build apparently changes the output dir of each project to one common location. Instead of the path to my database project being ..\..\MyDatabaseSolution\MyDatabaseProject\sql\ like it is when building locally, it gets set to something like ..\..\..\Binaries\Release\. How can I get around this and have a consistent output location to reference from my installer project? I'm using TFS 2005 and VS 2008.

    Read the article

  • Validation of viewstate MAC failed with nested master page

    - by just_name
    After I use a nested master page ,I face the following problem : Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. and sometimes Invalid related information [ViewStateException: Invalid viewstate. Client IP: 127.0.0.1 Port: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 ViewState: /wEPDwULLTEzOTY5MjA1ODUPZBYCZg9kFgICAw9kFg4CAQ9kFgJmDxYCHgRocmVmBUZmcm1faXRlbXMyLmFzcHg/c3lzPURGJmdycD0xJmRiPTUmZW1wPTc1NCZmaXJzdFJlcXVlc3Q9dHJ1ZSZMaXN0VHlwZT0xFgICAQ8PFgIeBFRleHQFATFkZAIDDxYCHgVjbGFzcwUGYWN0aXZlFgJmDxYCHwAFRmZybV9pdGVtczIuYXNweD9zeXM9REYmZ3JwPTEmZGI9NSZlbXA9NzU0JmZpcnN0UmVxdWVzdD10cnVlJkxpc3RUeXBlPTIWAgIBDw8WAh8BBQI3OGRkAgUPZBYCZg8WAh8ABUZmcm1faXRlbXMyLmFzcHg/c3lzPURGJmdycD0xJmRiPTUmZW1wPTc1NCZmaXJzdFJlcXVlc3Q9dHJ1ZSZMaXN0VHlwZT0zFgICAQ8PFgIfAQUDODY0ZGQCBw9kFgJmDxYCHwAFRmZybV9pdGVtczIuYXNweD9zeXM9REYmZ3JwPTEmZGI9NSZlbXA9NzU0JmZpcnN0UmVxdWVzdD10cnVlJkxpc3RUeXBlPTQWAgIBDw8WAh8BBQEwZGQCCQ9kFgJmDxYCHwAFP2ZybV9Vc2VyVGFza3MyLmFzcHg/c3lzPURGJmdycD0xJmRiPTUmZW1wPTc1NCZmaXJzdFJlcXVlc3Q9dHJ1ZWQCCw9kFgJmDxYCHwAFN1NlYXJjaC5hc3B4P3N5cz1ERiZncnA9MSZkYj01JmVtcD03NTQmZmlyc3RSZXF1ZXN0PXRydWVkAg8PZBYMAgQPEA8WBh4ORGF0YVZhbHVlRmllbGQFCFRhc2tDb2RlHg1EYXRhVGV4dEZpZWxkBQhUYXNrTmFt...] [HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.] System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +116 System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +13 System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +220 System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +5 System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37 System.Web.UI.HiddenFieldPageStatePersister.Load() +202 System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +106 System.Web.UI.Page.LoadAllState() +43 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3905 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +262 System.Web.UI.Page.ProcessRequest() +79 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 System.Web.UI.Page.ProcessRequest(HttpContext context) +109 ASP.frm_items2_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a961040e\19f53d4c\App_Web_frm_items2.aspx.cdcab7d2.nkfrbsfi.0.cs:0 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +399 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +76 I use this Tool to fix this problem but in vain !! I don't know even the root cause of this problem !!

    Read the article

  • Storing Arbitrary Contact Information in Ruby on Rails

    - by Anthony Chivetta
    Hi, I am currently working on a Ruby on Rails app which will function in some ways like a site-specific social networking site. As part of this, each user on the site will have a profile where they can fill in their contact information (phone numbers, addresses, email addresses, employer, etc.). A simple solution to modeling this would be to have a database column per piece of information I allow users to enter. However, this seems arbitrary and limited. Further, to support allowing users to enter as many phone numbers as they would like requires the addition of another database table and joins. It seems to me that a better solution would be to serialize all the contact information entered by a user into a single field in their row. Since I will never be conditioning a SQL query on this information, such a solution wouldn't be any less efficient. Ideally, I would like to use a vCard as my serialization format. vCards are the standard solution to storing contact information across the web, and reusing tested solutions is a Good Thing. Alternative serialization formats would include simply marshaling a ruby hash, or YAML. Regardless of serialization format, supporting the reading and updating of this information in a rails-like way seems to be a major implementation challenge. So, here's the question: Has anyone seen this approach used in a rails application? Are there any rails plugins or gems that make such a system easy to implement? Ideally what I would like is an acts_as_vcard to add to my model object that would handle editing the vcard for me and saving it back to the database.

    Read the article

  • How to handle SalesForce WSDL files for sandbox and production sites in ASP.Net?

    - by Traveling Tech Guy
    I need to authenticate users and get info about them from an ASP.Net application. Since I have 2 sites (sandbox, production) and 2 org IDs - I needed to generate 2 SalesForce WSDL files. I diffed the 2 files (each about 600kb in size) and while they are 95% the same, there are enough differences strewn all over the place - enough for me to need to use them both. I added both as web references to my solution, and here's where my problem starts.Obviously, I cannot use both references in the same file, as they contain the same classes/functions. I had to write a quick-and-dirty solution over the weekend, so I just created 2 classes - each using a different web reference - but otherwise the exact functionality, and I use the appropriate one, based on the URL the user is coming from. This works well, but strikes me as a bad (read: quick-and-dirty) solution. My question: is there any way to do one or more of the following: change the web reference on the fly? use both web references in the same file, but put one in a different namespace? find a better solution to the whole situation? I nd up with a huge XmlSerializer.dll (3mb!) - probably due to using both huge WSDL files. Thanks for your time.

    Read the article

  • System.Windows.Forms.DataVisualization Namespace Fine in One Class but Not in Another

    - by jxpx777
    Hi. I'm getting this error The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?) Here is my using section of the class: using System; using System.Collections; using System.Collections.Generic; using System.Windows.Forms.DataVisualization.Charting; using System.Windows.Forms.DataVisualization.Charting.Borders3D; using System.Windows.Forms.DataVisualization.Charting.ChartTypes; using System.Windows.Forms.DataVisualization.Charting.Data; using System.Windows.Forms.DataVisualization.Charting.Formulas; using System.Windows.Forms.DataVisualization.Charting.Utilities; namespace myNamespace { public class myClass { // Usual class stuff } } The thing is that I am using the same DataVisualization includes in another class. The only thing that I can think that is different is that the classes that are giving this missing namespace error are Solution Items rather than specific to a project. The projects reference them by link. Anyone have thoughts on what the problem is? I've installed the chart component, .Net 3.5 SP1, and the Chart Add-in for Visual Studio 2008. UPDATE: I moved the items from Solution Items to be regular members of my project and I'm still seeing the same behavior. UPDATE 2: Removing the items from the Solution Items and placing them under my project worked. Another project was still referencing the files which is why I didn't think it worked previously. I'm still curious, though, why I couldn't use the namespace when the classes were Solution Items but moving them underneath a project (with no modifications, mind you) instantly made them recognizable. :\

    Read the article

  • Passing arguments to objects created using the new operator?

    - by Abhijit
    Hi guys, I have a small C++ problem to which I don't know the best solution. I have two classes A and B as follows: class A { int n; B* b; public: A(int num): n(num) { b = new B[n]; for (int i = 0; i < n; i++) { b[i].setRef(this); } } ~A() { delete [] b; } }; class B { A* a; public: B() { } B(A* aref) { a = aref; } void setRef(A* aref) { a = aref; } }; I am creating an object of class A by passing to its constructor the number of objects of class B I want to be created. I want every object of class B to hold a pointer to the class A object that creates it. I think the best way to do this would be by passing the pointer to the class A object as a constructor argument to the class B object. However, since I'm using the new operator, the no-args constructor for class B is called. As a result, the only solution I can see here is calling the setRef(A*) method for every object of class B after it has been constructed using the new operator. Is there a better solution/design pattern that would be more applicable here? Would using placement new for class B be a better solution? Thanks in advance for your help.

    Read the article

  • Visual Studio 2008 freeze after save

    - by Klay
    I recently added about a dozen classes from another solution into my current solution in Visual Studio. After adding these classes, Visual Studio started freezing for about 10 seconds whenever I Save. The cursor disappears and mouse clicks and keys do nothing. Some interesting points: Even after I removed the classes, the freezing behavior is still there. Freezing occurs whether I've made changes to the code or not. This behavior ONLY seems to affect this particular version of this solution. No other solutions exhibit this behavior. Older versions of this solution are not affected. In Sysinternals Process Explorer, whenever I save in Visual Studio, the I/O bytes graph jumps from 0 to 2MB for about 5 seconds, then drops to about 1 MB for a split second, then jumps back to 2MB for another 5 seconds. Processor use goes up to about 3-5% during this time. Here are the details of my setup: C# Silverlight project (maybe 20 classes), .NET version 3.5 SP1, Visual Studio 2008 v9.0.30729 SP1. EDIT: I edited this question extensively to reflect the more detailed information. I thought this might be preferable to starting a new question.

    Read the article

  • Ruby Gem Install question + answer(on windows vista Home Basic environment)

    - by Vamsi
    Recently I am having problems with installing rcov gem on my windows (vista Home Basic environment), so after googling I found one solution and that is gem install rcov -v 0.8.1.1.0 #version that installs without errors gem update rcov #update to the latest version, in my case rcov-0.8.1.2.0-x86-mswin32 But this solution didn't worked on my colleague's system (windows xp) and after that we came to know about RubyInstaller devkit for winddows But that dev kit is not working on my vista, when I tried gem install rcov in my command prompt, it game me this error, C:\Users\Vamsi>gem install rcov Building native extensions. This could take a while... ERROR: Error installing rcov: ERROR: Failed to build gem native extension.ERROR: Failed to build gem native extension. D:/Spritle/Programs/Ruby/bin/ruby.exe extconf.rb creating Makefile nmake 'nmake' is not recognized as an internal or external command, operable program or batch file. Gem files will remain installed in D:/Spritle/Programs/Ruby/lib/ruby/gems/1.8/ge ms/rcov-0.9.8 for inspection. Results logged to D:/Spritle/Programs/Ruby/lib/ruby/gems/1.8/gems/rcov-0.9.8/ext /rcovrt/gem_make.out So after that my colleague tried to install nmake as well but it was throwing some other error. Can some one suggest a better solution for solving this problems for all windows environments? I am aware of cygwin for windows but I am not sure that is an 100% solution either.

    Read the article

  • Is my heuristic algorithm correct? (Sudoku solver)

    - by Aposperite
    First of -yes this IS a homework- but it's primarily a theoretical question rather than a practical one, I am simply asking a confirmation if I am thinking correctly or any hints if I am not. I have been asked to compile a simple Sudoku solver (on Prolog but that is not so important right now) with the only limitation being that it must utilize a heuristic function using Best-First Algorithm. The only heuristic function I have been able to come up with is explained below: 1. Select an empty cell. 1a. If there are no empty cells and there is a solution return solution. Else return No. 2. Find all possible values it can hold. %% It can't take values currently assigned to cells on the same line/column/box. 3. Set to all those values a heuristic number starting from 1. 4. Pick the value whose heuristic number is the lowest && you haven't checked yet. 4a. If there are no more values return no. 5. If a solution is not found: GoTo 1. Else Return Solution. // I am sorry for errors in this "pseudo code." If you want any clarification let me know. So am I doing this right or is there any other way around and mine is false? Thanks in advance.

    Read the article

  • Clarification needed: How does .NET runtime resolve assembly references from parent folder?

    - by aoven
    I have the following output structure of executables in my solution: %ProgramFiles% | +-[MyAppName] | +-[Client] | | | +-(EXE & several DLL assemblies) | +-[Common] | | | +-[Schema Assemblies] | | | | | +-(several DLL assemblies) | | | +-(several DLL assemblies) | +-[Server] | +-(EXE & several DLL assemblies) Each project in solution references different DLL assemblies, some of which are outputs from other projects in solution, and others are plain 3rd-party assemblies. For example, [Client] EXE might reference an assembly in [Common], which is in a different directory branch. All references have "Copy Local" set to false, to mirror the layout of the files in the final installed application. Now, if I take a look at reference properties in the Visual Studio IDE, I see that "Path" of every reference is absolute and that it corresponds to the actual output location of the assembly. That's understandable and correct. As expected, solution compiles and runs just fine. What I don't understand is, why everything seems to work even when I close the IDE, rename the [MyAppName] directory and run the [Client] EXE manually? How does the runtime find the assemblies if the reference paths aren't the same as they were at the time of linking? To be clear - this is actually exactly what I'm after: a semi-dispersed set of application files that run fine regardless of where the [MyAppName] directory is located or even what it's named. I'd just like to know, how and why this works without any specific path resolution on my part. I've read the answers to this similar question, but I still don't get it. Help much appreciated!

    Read the article

  • Which Project Management Software is adequate for Software & Non-Software Projects?

    - by cusack
    PMS = (Project Management Software) I used trac for software development some time ago. Right now I'm searching for a new more powerful (scheduling, gantt charts, ...) free solution (as in free beer ;-) and free to install on my server) for my current software project. Besides the current software project, abstract project management features like issue-tracking & scheduling would be great for coordinating a group of volunteers for real-life projects as well. I would want one solution for both purposes, so that I have the hassle of installation, getting used to the system and administration only once. So I tried redmine but the problem is it seems to be designed for software projects only. I can't suggest such a solution for the volunteer-group if tickets/issues would have to be of type bug, feature, ... I shortlisted the following six PMS from the wikipedia comparison http://en.wikipedia.org/wiki/List_of_project_management_software Project.net Project-Open Redmine Trac Endeavour Software Project Management eGroupWare I guess they are all more or less fine for software development but would you consider any of these to be good for the non-software project as well? Cliff Notes: I would want a start page situation like in trac. The start-page is a wiki presenting the project and not the PMS. But you can log into the PMS from there. Feature-wish list: wiki, Issue tracking, revision control, scheduling & gantt charts, forums (least important) (Btw: I'm very aware that I can't expect everything to be perfect ;-) 1.)Do you know a suitable solution for software and real-life projects or a highly customizable PMS where I can easily remove sth. like "browse source"(trac) and rename things like ticket/issue-types "bug", "feature"? 2.)Any experience good/bad with the above mentioned six PMS? I would personally guess that "Redmine" and "Endeavour Software Project Management" are too focused on software projects.

    Read the article

  • Migrating MOSS 2007 from SQL 2000 to SQL 2005 - Addendum

    - by lunacrescens
    This is a continuation of an earlier question I had about moving the databases for a MOSS 2007 installation from SQL 2000 to SQL 2005. Here's the URL for the original question: http://stackoverflow.com/questions/254517/migrating-moss-2007-from-sql-2000-to-sql-2005 In my test environment, I've successfully moved the databases to the SQL 2005 test machine and things appear to be working fine. But, on the "Servers in Farm" page of the Central Admin | Operations, it still shows the old (i.e. SQL 2000) server as the Configuration Database Server. Also, it shows the old config database as being the Configuration Database. I know that the SQL2000 server and old config database (that are showing on this page) are NOT being used, because we've deactived the SQL instance in SQL2000. I've tried "removing" the server, and get a message about "Uninstalling SharePoint products and technologies" being the better route. So, I disconnected from the test databases, uninstalled SharePoint from the test WFE server, and reinstalled it. That didn't do anything. Before uninstalling/reinstalling I also tried simply rerunning the SharePoint Configuration wizard, and that didn't do anything either. Does anyone know how to update the Config Server and Config Database on the "Servers in Farm" page after having moved the Config and Content DBs? Is there something I'm missing or overlooking? Thanks.

    Read the article

  • django powering multiple shops from one code base on a single domain

    - by imanc
    Hey, I am new to django and python and am trying to figure out how to modify an existing app to run multiple shops through a single domain. Django's sites middleware seems inappropriate in this particular case because it manages different domains, not sites run through the same domain, e.g. : domain.com/uk domain.com/us domain.com/es etc. Each site will need translated content - and minor template changes. The solution needs to be flexible enough to allow for easy modification of templates. The forms will also need to vary a bit, e.g minor variances in fields and validation for each country specific shop. I am thinking along the lines of the following as a solution and would love some feedback from experienced django-ers: In short: same codebase, but separate country specific urls files, separate templates and separate database Create a middleware class that does IP localisation, determines the country based on the URL and creates a database connection, e.g. /au/ will point to the au specific database and so on. in root urls.py have routes that point to a separate country specific routing file, e..g (r'^au/',include('urls_au')), (r'^es/',include('urls_es')), use a single template directory but in that directory have a localised directory structure, e.g. /base.html and /uk/base.html and write a custom template loader that looks for local templates first. (or have a separate directory for each shop and set the template directory path in middleware) use the django internationalisation to manage translation strings throughout slight variances in forms and models (e.g. ZA has an ID field, France has 'door code' and 'floor' etc.) I am unsure how to handle these variations but I suspect the tables will contain all fields but allowing nulls and the model will have all fields but allowing nulls. The forms will to be modified slightly for each shop. Anyway, I am keen to get feedback on the best way to go about achieving this multi site solution. It seems like it would work, but feels a bit "hackish" and I wonder if there's a more elegant way of getting this solution to work. Thanks, imanc

    Read the article

  • [UNIX] Sort lines of massive file by number of words on line (ideally in parallel)

    - by conradlee
    I am working on a community detection algorithm for analyzing social network data from Facebook. The first task, detecting all cliques in the graph, can be done efficiently in parallel, and leaves me with an output like this: 17118 17136 17392 17064 17093 17376 17118 17136 17356 17318 12345 17118 17136 17356 17283 17007 17059 17116 Each of these lines represents a unique clique (a collection of node ids), and I want to sort these lines in descending order by the number of ids per line. In the case of the example above, here's what the output should look like: 17118 17136 17356 17318 12345 17118 17136 17356 17283 17118 17136 17392 17064 17093 17376 17007 17059 17116 (Ties---i.e., lines with the same number of ids---can be sorted arbitrarily.) What is the most efficient way of sorting these lines. Keep the following points in mind: The file I want to sort could be larger than the physical memory of the machine Most of the machines that I'm running this on have several processors, so a parallel solution would be ideal An ideal solution would just be a shell script (probably using sort), but I'm open to simple solutions in python or perl (or any language, as long as it makes the task simple) This task is in some sense very easy---I'm not just looking for any old solution, but rather for a simple and above all efficient solution

    Read the article

  • ASMX Web Service online works when all of the code is in one file without code-behind

    - by Ben McCormack
    I have an ASMX Web Service that has its code entirely in a code-behind file, so that the entire contents of the .asmx file is: <%@ WebService Language="C#" CodeBehind="~/App_Code/AddressValidation.cs" Class="AddressValidation" %> On my test machine (Windows XP with IIS 5), I set up a virtual directory just for this ASP.NET 2.0 solution and everything works great. All my code is separated nicely and it just works. However, when we deployed this solution to our Windows Server 2003 development environment, we noticed that the code only compiled when all of the code was dropped directly into the .asmx file, meaning that the solution didn't work with code-behind. We can't figure out why this is happening. One thing that's different about our setup in our development environment is that instead of creating a separate virual directory just for this solution, we dropped it into an existing directory that runs a classic ASP application. So here we have a folder with an ASP.NET 2.0 application within a directory that contains a classic ASP application. Granted, everything in the ASP.NET 2.0 application works if all of the code is within the .asmx file and not in code-behind, but we'd really like to know why it's not recognizing the code-behind files and compiling it correctly.

    Read the article

  • Automatically add links to class source files under a specified directory of an another project in V

    - by Binary255
    I want to share some class source files between two projects in Visual Studio 2008. I can't create a project for the common parts and reference it (see my comment if you are curious to why). I've managed to share some source files, but it could be a lot more neat. I've created a test solution called Commonality. The Solution Explorer of the Commonality solution which contains project One and Two: What I like: All class files under the Common folder of project One are automatically added to project Two by linking. It's mostly the same as if I would have chosen Add / Existing Item... : Add As Link on each new class source file. It's clear that these files have been linked in. The shortcut arrow symbol is marking each file icon. What I do not like: The file and folder tree structure under Common of project One isn't included. It's all flat. The linked source files are shown under the project root of project Two. It would look much less cluttered if they were located under Common like in project One. The file tree structure of the Commonality solution which contains project One and Two: $ tree /F /A Folder PATH listing for volume Cystem Volume serial number is 0713370 1337:F6A4 C:. | Commonality.sln | +---One | | One.cs | | One.csproj | | | +---bin | | \---Debug | | One.vshost.exe | | One.vshost.exe.manifest | | | +---Common | | | Common.cs | | | CommonTwo.cs | | | | | \---SubCommon | | CommonThree.cs | | | +---obj | | \---Debug | | +---Refactor | | \---TempPE | \---Properties | AssemblyInfo.cs | \---Two | Two.cs | Two.csproj | Two.csproj.user | Two.csproj~ | +---bin | \---Debug +---obj | \---Debug | +---Refactor | \---TempPE \---Properties AssemblyInfo.cs And the relevant part of project Two's project file Two.csproj: <ItemGroup> <Compile Include="..\One\Common\**\*.cs"> </Compile> <Compile Include="Two.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> How do I address what I do not like, while keeping what I like?

    Read the article

  • restrict script inside iframe to run only within pages of same top-level domain?

    - by Justin Grant
    I'd like to enforce a requirement that client script inside a page (which in turn is loaded inside an iframe of another page) will only run when the parent page is on the same top-level domain as the framed page (although it may be on another hostname in that domain). Is this do-able? I assume that the easy solution of looking at top.location.host won't be available due to cross-site scripting limitations, but I'm wondering if other javascript hackery could suffice. Constraints on any potential solution inculde: I need to be able to run XmlHttpRequest calls inside the child page, and I need to validate that the hostname is in the same domain before I make those calls. (this makes a document.domain solution challenging because AFAIK setting document.domain disables the ability to make XmlHttpRequest calls. I can control client-side script and HTML on both parent or child (and I can create new pages if needed), but I can't make any server-side code changes. I can't simulate the above via server-side calls or proxies, because the child page's hostname uses a forms auth system with hostname-scoped cookies that I can't get access to from the parent page since it's on a different hostname. I don't have enough control over the child-frame site to be able to put both sites behind the same reverse-proxy or load-balancer (which would enable me to put both sites on the same hostname). I don't actually need to access any UI inside the IFrame-- the iframe is invisible and I'm only using it to run javascript within the security context of a site on a different hostname from the parent page. So at this point I'm stumped. Got any ideas? I want to make sure I'm not overlooking an easy solution before giving up.

    Read the article

  • Efficient Method for Preventing Hotlinking via .htaccess

    - by Michael Robinson
    I need to confirm something before I go accuse someone of ... well I'd rather not say. The problem: We allow users to upload images and embed them within text on our site. In the past we allowed users to hotlink to our images as well, but due to server load we unfortunately had to stop this. Current "solution": The method the programmer used to solve our "too many connections" issue was to rename the file that receives and processes image requests (image_request.php) to image_request2.php, and replace the contents of the original with <?php header("HTTP/1.1 500 Internal Server Error") ; ?> Obviously this has caused all images with their src attribute pointing to the original image_request.php to be broken, and is also the wrong code to be sending in this case. Proposed solution: I feel a more elegant solution would be: In .htaccess If the request is for image_request.php Check referrer If referrer is not our site, send the appropriate header If referrer is our site, proceed to image_request.php and process image request What I would like to know is: Compared to simply returning a 500 for each request to image_request.php: How much more load would be incurred if we were to use my proposed alternative solution outlined above? Is there a better way to do this? Our main concern is that the site stays up. I am not willing to agree that breaking all internally linked images is the best / only way to solve this. I refuse to tell our users that because of something WE changed they must now manually change the embed code in all their previously uploaded content.

    Read the article

  • Method for defining simultaneous has-many and has-one associations between two models in CakePHP?

    - by Hobonium
    One thing with which I have long had problems, within the CakePHP framework, is defining simultaneous hasOne and hasMany relationships between two models. For example: BlogEntry hasMany Comment BlogEntry hasOne MostRecentComment (where MostRecentComment is the Comment with the most recent created field) Defining these relationships in the BlogEntry model properties is problematic. CakePHP's ORM implements a has-one relationship as an INNER JOIN, so as soon as there is more than one Comment, BlogEntry::find('all') calls return multiple results per BlogEntry. I've worked around these situations in the past in a few ways: Using a model callback (or, sometimes, even in the controller or view!), I've simulated a MostRecentComment with: $this->data['MostRecentComment'] = $this->data['Comment'][0]; This gets ugly fast if, say, I need to order the Comments any way other than by Comment.created. It also doesn't Cake's in-built pagination features to sort by MostRecentComment fields (e.g. sort BlogEntry results reverse-chronologically by MostRecentComment.created. Maintaining an additional foreign key, BlogEntry.most_recent_comment_id. This is annoying to maintain, and breaks Cake's ORM: the implication is BlogEntry belongsTo MostRecentComment. It works, but just looks...wrong. These solutions left much to be desired, so I sat down with this problem the other day, and worked on a better solution. I've posted my eventual solution below, but I'd be thrilled (and maybe just a little mortified) to discover there is some mind-blowingly simple solution that has escaped me this whole time. Or any other solution that meets my criteria: it must be able to sort by MostRecentComment fields at the Model::find level (ie. not just a massage of the results); it shouldn't require additional fields in the comments or blog_entries tables; it should respect the 'spirit' of the CakePHP ORM. (I'm also not sure the title of this question is as concise/informative as it could be.)

    Read the article

  • Word-wrap grid cells in Ext JS

    - by richardtallent
    (This is not a question per se, I'm documenting a solution I found using Ext JS 3.1.0. But, feel free to answer if you know of a better solution!) The Column config for an Ext JS Grid object does not have a native way to allow word-wrapped text, but there is a css property to override the inline CSS of the TD elements created by the grid. Unfortunately, the TD elements contain a DIV element wrapping the content, and that DIV is set to white-space:nowrap by Ext JS's stylesheet, so overriding the TD CSS does no good. I added the following to my main CSS file, a simple fix that appears to not break any grid functionality, but allows any white-space setting I apply to the TD to pass through to the DIV. .x-grid3-cell { /* TD is defaulted to word-wrap. Turn it off so it can be turned on for specific columns. */ white-space:nowrap; } .x-grid3-cell-inner { /* Inherit DIV's white-space from TD parent, since DIV's inline style is not accessible in the column definition. */ white-space:inherit; } YMMV, but it works for me, wanted to get it out there as a solution since I couldn't find a working solution by searching the Interwebs.

    Read the article

< Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >