Search Results

Search found 1038 results on 42 pages for 'jon galloway'.

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

  • Why aren't static const floats allowed?

    - by Jon Cage
    I have a class which is essentially just holds a bunch of constant definitions used through my application. For some reason though, longs compile but floats do not: class MY_CONSTS { public : static const long LONG_CONST = 1; // Compiles static const float FLOAT_CONST = 0.001f; // C2864 }; Gives the following error: 1>c:\projects\myproject\Constant_definitions.h(71) : error C2864: 'MY_CONSTS::FLOAT_CONST' : only static const integral data members can be initialized within a class Am I missing something?

    Read the article

  • IIS 6/.Net 2:How can user A get the user cookie for unrelated user B who is in a different session a

    - by jon.ediger
    1) user A goes to the site, creates an account, and logs in 2) user b goes to the site. Rather than having to log in, user b enters as though user b is user a. User b gets access to all of user a's data and can brows the site as user a. Note: user b does not log in. User b just hits the site, and the site returns as if user b is already logged in as user a. Note 2: user a and user b are on distinct computers. Also, static variables are not involved in the code. Setup: IIS 6 .Net 2.0 OutputCache off for the pages in the site

    Read the article

  • Load SWF data without loading sound, then load sound later

    - by Jon Sandness
    So, hypothetical situation here: I have an SWF that's 30MB. Sound files (music) make up 25MB, art and other things make up the remaining 5MB. Would it be possible for me to load the 5MB of necessary art and other things first to allow the user to operate the app, then after that's all loaded and they are operating the app, load the remaining 25MB of sound files in the background? UPDATE: Loading SWF externally is not an option.

    Read the article

  • JPA IndirectSet changes not reflected in Spring frontend

    - by Jon
    I'm having an issue with Spring JPA and IndirectSets. I have two entities, Parent and Child, defined below. I have a Spring form in which I'm trying to create a new Child and link it to an existing Parent, then have everything reflected in the database and in the web interface. What's happening is that it gets put into the database, but the UI doesn't seem to agree. The two entities that are linked to each other in a OneToMany relationship like so: @Entity @Table(name = "parent", catalog = "myschema", uniqueConstraints = @UniqueConstraint(columnNames = "ChildLinkID")) public class Parent { private Integer id; private String childLinkID; private Set<Child> children = new HashSet<Child>(0); @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false) public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } @Column(name = "ChildLinkID", unique = true, nullable = false, length = 6) public String getChildLinkID() { return this.childLinkID; } public void setChildLinkID(String childLinkID) { this.childLinkID = childLinkID; } @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "parent") public Set<Child> getChildren() { return this.children; } public void setChildren(Set<Child> children) { this.children = children; } } @Entity @Table(name = "child", catalog = "myschema") public class Child extends private Integer id; private Parent parent; @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false) public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ChildLinkID", referencedColumnName = "ChildLinkID", nullable = false) public Parent getParent() { return this.parent; } public void setParent(Parent parent) { this.parent = parent; } } And of course, assorted simple properties on each of them. Now, the problem is that when I edit those simple properties from my Spring interface, everything works beautifully. I can persist new entities of these types and they'll appear when using the JPATemplate to do a find on, say, all Parents (getJpaTemplate().find("select p from Parent p")) or on individual entities by ID or another property. The problem I'm running into is that now, I'm trying to create a new Child linked to an existing Parent through a link from the Parent's page. Here's the important bits of the Controller (note that I've placed the JPA foo in the controller here to make it clearer; the actual JpaDaoSupport is actually in another class, appropriately tiered): protected Object formBackingObject(HttpServletRequest request) throws Exception { String parentArg = request.getParameter("parent"); int parentId = Integer.parseInt(parentArg); Parent parent = getJpaTemplate().find(Parent.class, parentId); Child child = new Child(); child.setParent(parent); NewChildCommand command = new NewChildCommand(); command.setChild(child); return command; } protected ModelAndView onSubmit(Object cmd) throws Exception { NewChildCommand command = (NewChildCommand)cmd; Child child = command.getChild(); child.getParent().getChildren().add(child); getJpaTemplate().merge(child); return new ModelAndView(new RedirectView(getSuccessView())); } Like I said, I can run through the form and fill in the new values for the Child -- the Parent's details aren't even displayed. When it gets back to the controller, it goes through and saves it to the underlying database, but the interface never reflects it. Once I restart the app, it's all there and populated appropriately. What can I do to clear this up? I've tried to call extra merges, tried refreshes (which gave a transaction exception), everything short of just writing my own database access code. I've made sure that every class has an appropriate equals() and hashCode(), have full JPA debugging on to see that it's making appropriate SQL calls (it doesn't seem to make any new calls to the Child table) and stepped through in the debugger (it's all in IndirectSets, as expected, and between saving and displaying the Parent the object takes on a new memory address). What's my next step?

    Read the article

  • Implicitly including optional dependencies in Maven

    - by Jon Todd
    I have a project A which has a dependency X. Dependency X has an optional dependency Y which doens't get included in A by default. Is there a way to include Y in my POM without explicitly including it? In Ivy they have a way to essentailly say include all optional dependencies of X, does Maven have a way to do this?

    Read the article

  • Jquery Accordion Close then Open

    - by Jon
    Hi Everyone, I've set up a number of accordions on a page using the jquery accordion plugin so I can implement expand all and collapse all functionality. Each ID element is it's own accordion and the code below works to close them all no matter which ones are already open: $("#contact, #address, #email, #sales, #equipment, #notes, #marketingdata") .accordion("activate", -1) ; My problem is with the expand all. When I have them all expand with this code: $("#contact, #address, #email, #sales, #equipment, #notes, #marketingdata") .accordion("activate", 0) ; Some will contract and some will expand based on whether or not they are previously open. My idea to correct this was to collapse them all and then expand them all when the expand all was clicked. This code however won't execute properly: $("#contact, #address, #email, #sales, #equipment, #notes, #marketingdata") .accordion("activate", -1) ; $("#contact, #address, #email, #sales, #equipment, #notes, #marketingdata") .accordion("activate", 0) ; It will only hit the second command and not close them all first. Any suggestions?

    Read the article

  • Tool to convert inline C# into a code behind file

    - by Jon Jones
    Hi I have a number of legacy web controls (ascx) that contains huge amounts of inline C#. The forms contain a number of repeated and duplicate code. Our first plan is to move the code into code behinds per file, then refactor etc... were doing this to upgrade the client to the latest version of their cms At the moment we are going to have to manually copy and paste from hundreds of files, create a code behind, copy the code, add the namespaces based on the client-side imports and then do any tidying up does anybody PLEASE know of a tool that can do the majority of this work for us ? Thanks

    Read the article

  • C# Using Enumerable Range and Except with custom class to determine missing sequence number

    - by Jon
    I have a List<MyClass> The class is like this: private class MyClass { public string Name{ get; set; } public int SequenceNumber { get; set; } } I want to work out what Sequence numbers might be missing. I can see how to do this here however because this is a class I am unsure what to do? I think I can handle the except method ok with my own IComparer but the Range method I can't figure out because it only excepts int so this doesn't compile: Enumerable.Range(0, 1000000).Except(chqList, MyEqualityComparer<MyClass>); Here is the IComparer: public class MyEqualityComparer<T> : IEqualityComparer<T> where T : MyClass { #region IEqualityComparer<T> Members public bool Equals(T x, T y) { return (x == null && y == null) || (x != null && y != null && x.SequenceNumber.Equals(y.SequenceNumber)); } /// </exception> public int GetHashCode(T obj) { if (obj == null) { throw new ArgumentNullException("obj"); } return obj.GetHashCode(); } #endregion }

    Read the article

  • Text -> Diagram Tool

    - by Jon
    I'm looking for an diagram tool for producing diagrams from text. I only really need sequence and state type diagrams for now, but I'm curious as to what people would recommend? I need something which is standalone, not a web based tool that works on Linux, OSX and Windows.

    Read the article

  • Visual studio: automatically update C++ cpp/header file when the other is changed?

    - by Jon
    For example, if I change the signature in a function in either the header or the cpp, I'd like it to automatically change in the other one. If I add a new function in either, it should appear in both. If I delete a function, it could probably comment out the other one. Manually having to duplicate one's changes seems silly. Some people have mentioned http://www.lazycplusplus.com/ in response to a similar question, but it seems that that's a command line tool which would require saving and then running this external tool on a particular file. That's still more manual steps than I would have thought were necessary; I'd like this to apply changes as I type.

    Read the article

  • What's your most controversial programming opinion?

    - by Jon Skeet
    This is definitely subjective, but I'd like to try to avoid it becoming argumentative. I think it could be an interesting question if people treat it appropriately. The idea for this question came from the comment thread from my answer to the "What are five things you hate about your favorite language?" question. I contended that classes in C# should be sealed by default - I won't put my reasoning in the question, but I might write a fuller explanation as an answer to this question. I was surprised at the heat of the discussion in the comments (25 comments currently). So, what contentious opinions do you hold? I'd rather avoid the kind of thing which ends up being pretty religious with relatively little basis (e.g. brace placing) but examples might include things like "unit testing isn't actually terribly helpful" or "public fields are okay really". The important thing (to me, anyway) is that you've got reasons behind your opinions. Please present your opinion and reasoning - I would encourage people to vote for opinions which are well-argued and interesting, whether or not you happen to agree with them.

    Read the article

  • Using ret with FASM on Win32

    - by Jon Purdy
    I'm using SDL with FASM, and have code that's minimally like the following: format ELF extrn _SDL_Init extrn _SDL_SetVideoMode extrn _SDL_Quit extrn _exit SDL_INIT_VIDEO equ 0x00000020 section '.text' public _SDL_main _SDL_main: ccall _SDL_Init, SDL_INIT_VIDEO ccall _SDL_SetVideoMode, 640, 480, 32, 0 ccall _SDL_Quit ccall _exit, 0 ; Success, or ret ; failure. With the following quick-and-dirty makefile: SOURCES = main.asm OBJECTS = main.o TARGET = SDLASM.exe FASM = C:\fasm\fasm.exe release : $(OBJECTS) ld $(OBJECTS) -LC:/SDL/lib/ -lSDLmain -lSDL -LC:/MinGW/lib/ -lmingw32 -lcrtdll -o $(TARGET) --subsystem windows cleanrelease : del $(OBJECTS) %.o : %.asm $(FASM) $< $@ Using exit() (or Windows' ExitProcess()) seems to be the only way to get this program to exit cleanly, even though I feel like I should be able to use retn/retf. When I just ret without calling exit(), the application does not terminate and needs to be killed. Could anyone shed some light on this? It only happens when I make the call to SDL_SetVideoMode().

    Read the article

  • C# console applications all 16bit?

    - by Jon
    Hi all, I was reading up about NTVDM.exe as I build a quick test console app and it crashed on a friends machine complaining about this EXE. As I understand it all DOS cmd windows (C# console apps included) run as 16bit not 32bit. Is this true? Does this mean all my works console app back office apps are running as 16bit rather than making the most of the 32bit available? What about Windows services? As I believe we wrote it as a console app then made it run as a windows service? Thanks

    Read the article

  • Problem with multiple forms on one page

    - by Jon
    I have two forms on a web page. The first is not an actual form since this is a .NET based site. So instead I have the standard input fields, along with asp:Button PostBackURL="http:/www...". One of the fields is "email". That works fine. Then I have an XSLT file with another form, and am using Javascript (via this.form.action, .method, etc) to post that form. Besides that it has the same fields as the form above. The problem is that when someone submits the second form, the script at the PostBackURL returns an error because the "email" field appears empty. So it seems as though the form is submitting the "email" field form the top form instead of the current one. I thought maybe the wrong form is being submitted, but if I remove the "email" field from the top form, and then submit the bottom one, it works fine. Any ideas on how to fix this? Thanks.

    Read the article

  • Encryption puzzle / How to create a ProxyStub for a Remote Assistance ticket

    - by Jon Clegg
    I am trying to create a ticket for Remote Assistance. Part of that requires creating a PassStub parameter. As of the documenation: http://msdn.microsoft.com/en-us/library/cc240115(PROT.10).aspx PassStub: The encrypted novice computer's password string. When the Remote Assistance Connection String is sent as a file over e-mail, to provide additional security, a password is used.<16 In part 16 they detail how to create as PassStub. In Windows XP and Windows Server 2003, when a password is used, it is encrypted using PROV_RSA_FULL predefined Cryptographic provider with MD5 hashing and CALG_RC4, the RC4 stream encryption algorithm. As PassStub looks like this in the file: PassStub="LK#6Lh*gCmNDpj" If you want to generate one yourself run msra.exe in Vista or run the Remote Assistance tool in WinXP. The documentation says this stub is the result of the function CryptEncrypt with the key derived from the password and encrypted with the session id (Those are also in the ticket file). The problem is that CryptEncrypt produces a binary output way larger then the 15 byte PassStub. Also the PassStub isn't encoding in any way I've seen before. Some interesting things about the PassStub encoding. After doing statistical analysis the 3rd char is always a one of: !#$&()+-=@^. Only symbols seen everywhere are: *_ . Otherwise the valid characters are 0-9 a-z A-Z. There are a total of 75 valid characters and they are always 15 bytes. Running msra.exe with the same password always generates a different PassStub, indicating that it is not a direct hash but includes the rasessionid as they say. Some other ideas I've had is that it is not the direct result of CryptEncrypt, but a result of the rasessionid in the MD5 hash. In MS-RA (http://msdn.microsoft.com/en-us/library/cc240013(PROT.10).aspx). The "PassStub Novice" is simply hex encoded, and looks to be the right length. The problem is I have no idea how to go from any hash to way the ProxyStub looks like.

    Read the article

  • TooManyRowsAffectedException with encrypted triggers

    - by Jon Masters
    I'm using nHibernate to update 2 columns in a table that has 3 encrypted triggers on it. The triggers are not owned by me and I can not make changes to them, so unfortunately I can't SET NOCOUNT ON inside of them. Is there another way to get around the TooManyRowsAffectedException that is thrown on commit? Update 1 So far only way I've gotten around the issue is to step around the .Save routine with var query = session.CreateSQLQuery("update Orders set Notes = :Notes, Status = :Status where OrderId = :Order"); query.SetString("Notes", orderHeader.Notes); query.SetString("Status", orderHeader.OrderStatus); query.SetInt32("Order", orderHeader.OrderHeaderId); query.ExecuteUpdate(); It feels dirty and is not easily to extend, but it doesn't crater.

    Read the article

  • How do I use NTLM authentication with Active Directory

    - by Jon Works
    I am trying to implement NTLM authentication on one of our internal sites and everything is working. The one piece of the puzzle I do not have is how to take the information from NTLM and authenticate with Active Directory. There is a good description of NTLM and the encryption used for the passwords, which I used to implement this, but I am not sure of how to verify if the user's password is valid. I am using Coldfusion but a solution to this problem can be in any language (Java, Python, PHP, etc). Edit: I am using Coldfusion on Redhat Enterprise Linux. Unfortunately we cannot use IIS to manage this and instead have to write or use a 3rd party tool for this.

    Read the article

  • How do I use unsafe values in an enum?

    - by Jon Tackabury
    I need to use this enum in my C# application, but it won't let me use these values. When I specify the type as uint I can use the -1 value, and when I specify int I can't use the last 2 values. Is there a way to use the unchecked keyword here to allow me to define all of these values? These values are coming from an external source, so I can't change them. internal enum MyValues : int { value1 = -1, value2 = 0, value3 = 0x80000000, value4 = 0xFFFFFFFF }

    Read the article

  • Reuse, Rewrite, or Refactor?

    - by Jon Purdy
    At work I inherited development of a PHP-based Web site after the consultant who originally produced it bailed out and left without a trace. Literally half of the code is ripped from online tutorials, and there are thousands of lines of cruft that, being incomplete, do precious little. Hardly any of it actually works. I've been trying to pull out the usable components, such as the layout (cleverly intermixed with code), session management (delicately seasoned with unescaped, unvalidated SQL queries), and a few other things, but it's very difficult to force all of this junk into place. Further, I don't speak idiomatic PHP, being more of a Perl user, and I'm supposed to be on this project principally for maintenance, so rewriting everything seems like it would take just as long as wrestling the existing monster back into place. As an aside, I have literally never seen anything as badly written as this. Welcome me to the world of working with other people's code, I guess, but I do hope it's not this common in the real world to have such gems as these: // WHY IS THIS NOT WORKING // I know this is bad but were going for working stuff right now... // This is a PHP code outputing Javascript code outputting HTML...do not go further // Not userful I'm looking for the best advice I can get here. What would you do if you were in my position?

    Read the article

  • Access Violation Exception only appearing when running C# app without debugger attached

    - by Jon
    I have an application that works fine in Visual Studios 2008, and I am trying to get it into VS 2010 in order to use .NET 4, and I have a really weird problem. When I run the code from either Release mode or Debug mode with the debugger attached (F5), I have no problems running the program. However, when I run the program from either Release or Debug without the debugger attached (Shift+F5), I get an Access Violation Exception when I attempt to run some code in a dll from GDCM. I've created the dlls by using CMake and Swig and following the instructions here adjusting the instructions where necessary to build for VS 2010 and .NET 4. Does any one have any ideas why this is happening and how I can fix it?

    Read the article

  • firefox lead dot in cookie issue

    - by Jon
    Hi all, We are having an annoying issue with Firefox and cookies. We have the following domains: sub1.mydomain.com sub2.mydomain.com sub3.mydomain.com otherdomain.com We have converting our framework to be multilingual and providing a drop down to change the language at any point during site. The code base is shared across all the domains above. We can not set a cookie across all "mydomain.com" sites, they have to be on each of the sub domains. To get this to work we set a JavaScript cookie when the users chooses a new language. When the page posts back to the server the code picks this up and sets the users preferences to that new language code, (this is all C# and ASP.NET). We have to set the host to be "subX.mydomain.com" and the path to be "/" in the cookie so that it is just for the subdomain and all parts of that domain. This works great on all browsers apart from FireFox. It seems that firefox will pre append a DOT to the beginning of domain so ".subX.mydomain.com". When the code posts back with FireFox the cookie is always null. Has anyone had this situation, (I imagine it is not al that uncommon). I have read a lot of people saying, remove the domain from the cookie, but that can not work for us as we have multiple subdomains that need their own cookie values. Thanks

    Read the article

  • Safari ignores input type="file" on server post

    - by Jon
    I have a real problem with a classic ASP page. The page allows the user to upload a document and save it to the database. The intial page posts to another asp page which saves down to the db. This works on IE and Firefox. However on Safari it fails. I've debugged the problem and it boils down to the fact that of all the controls that the server page has access to, only 1 control is missing. This happens to be this: <input type="file" size="40" id="myfile" name="myfile" /> So I'm wondering why safari would decide to not give me access to this control (using asp's Request("") ) and why it works in FF and IE. I have some debug code which writes out all controls and it doesn't see this control. p.s. I hate Web development

    Read the article

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