Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 198/332 | < Previous Page | 194 195 196 197 198 199 200 201 202 203 204 205  | Next Page >

  • Define a new handle (Similar to STDOUT)

    - by Monacraft
    I was looking at redirecting handles in batch, when I noticed this: Here is the link It mentions that Handle 3-9 are undefined and can be defined by a program. Now I've read about doing this in C#, but I wondered if this was possible in cmd/batch - and if it is what are its limitations/use. If it is not possible in cmd how would I go about using this, and could it be a soloution to outputing data to the screen and redirecting it to a file at the same time (a problem which has not been able to be done legitametly at the same time). Thanks, Mona.

    Read the article

  • ASP.NET MVC2 - usage of LINQ-generated class (validation problem)

    - by ile
    There are few things not clear to me about ASP.NET MV2. In database I have table Contacts with several fields, and there is an additional field XmlFields of which type is xml. In that field are stored additional description fields. There are 4 classes: Contact class which corresponds to Contact table and is defined by default when creating LINQ classes ContactListView class which inherits Contact class and has some additional properties ContactXmlView class that contains fields from XmlFields field ContactDetailsView class which merges ContactListView and ContactXmlView into one class and this one is used to display data in view pages ContactListView class has re-defined some properties from Contact class (so that I can add [Required] filter used for validation) - but I get warning message: 'ObjectTest.Models.Contacts.ContactListView.FirstName' hides inherited member 'SA.Model.Contact.FirstName'. Use the new keyword if hiding was intended. ContactDetailsView class is also used in a form when creating new contact and adding it to database. I am not sure if this is correct way, and the warning message confuses me a bit. Any advise about this? Thanks, Ile EDIT According to Jakob's instructions I tried it from scratch: [MetadataType(typeof(Person_Validation))] public partial class Person { } public class Person_Validation { [Required] string FirstName { get; set; } [Required] string LastName { get; set; } [Required] int Age { get; set; } } In Controller I have this: [HttpPost] public ActionResult Create(Person person, FormCollection collection) { if (ModelState.IsValid) { try { personRepository.Add(person); personRepository.Save(); } catch { return View(person); } } return RedirectToAction("Index"); } View: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Validate.Models.Person>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Create </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Create</h2> <% using (Html.BeginForm()) {%> <%= Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <div class="editor-label"> <%= Html.LabelFor(model => model.FirstName) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.FirstName) %> <%= Html.ValidationMessageFor(model => model.FirstName) %> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.LastName) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.LastName) %> <%= Html.ValidationMessageFor(model => model.LastName) %> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Age) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Age) %> <%= Html.ValidationMessageFor(model => model.Age) %> </div> <p> <input type="submit" value="Create" /> </p> </fieldset> <% } %> <div> <%= Html.ActionLink("Back to List", "Index") %> </div> </asp:Content> When posting new person with no values, nothing happens (page is just reloaded). When posting with some values, person is added to db. I have no idea what am I doing wrong.

    Read the article

  • How do I check for Existence of a Record in GAE

    - by VDev
    I am trying to create a simple view in Django & GAE, which will check if the user has a profile entity and prints a different message for each case. I have the program below, but somehow GAE always seem to return a object. My program is below import datetime from django.http import HttpResponse, HttpResponseRedirect from google.appengine.api import users from google.appengine.ext import db from models import Profile import logging #from accounts.views import profile # Create your views here. def login_view(request): user = users.get_current_user() profile = db.GqlQuery("SELECT * FROM Profile WHERE account = :1", users.get_current_user()) logging.info(profile) logging.info(user) if profile: return HttpResponse("Congratulations Your profile is already created.") else: return HttpResponse("Sorry Your profile is NOT created.") My model object is Profile defined as follows: class Profile(db.Model): first_name = db.StringProperty() last_name = db.StringProperty() gender = db.StringProperty(choices=set(["Male", "Female"])) account = db.UserProperty(required = True) friends = db.ListProperty(item_type=users.User) last_login = db.DateTimeProperty(required=True) Thanks for the help.

    Read the article

  • ASP.NET GridView - how to enable validation declaratively

    - by Joe
    It it possible to enable validation in an ASP.NET GridView purely declaratively? What I've tried: A GridView bound to an ObjectDataSource with SelectMethod and UpdateMethod defined The GridView contains some ReadOnly BoundField columns and a TemplateField whose EditTemplate contains a TextBox and a RegularExpressionValidator that only allows numeric input in the TextBox. The GridView also contains a CommandField with ShowEditButton=true and CausesValidation=true. If I click on Edit, enter an invalid value, then click on Save, there is a PostBack, and an exception is thrown in the server (Input string was not in a correct format). I can of course avoid this by adding validation code to the RowUpdating event handler on the server (see below), but is there any declarative way to force the validation to be done without adding this code? protected void MyGridView_RowUpdating(object sender, GridViewUpdateEventArgs e) { Page.Validate("MyValidationGroup"); if (!Page.IsValid) { e.Cancel = true; } }

    Read the article

  • AS3 Components in Flash Designer

    - by Jack Voight
    In an ActionScript 2 project I can create a new MovieClip, right-click on it on the library and select "Component Definition" to add parameters that can be referenced inside the MovieClip. This parameters can be easily changed in the MovieClips's properties. Now, I'm working on an ActionScript 3 project but haven't been able to figure out a way to obtain the values passed in those parameters. I defined a parameter named "textToDisplay" but when I write the following in the Actions for the first frame I get an error: trace(textToDisplay); This is the error: 1120: Access of undefined property textToDisplay. Do you know how to capture the value of that parameter? Thanks PS: I'm using Adobe Flash CS3 Professional on Windows XP

    Read the article

  • How can I measure file access performance (and volume) of a (Java) application

    - by stmoebius
    Given an application, how can I measure the amount of data read and written by that application? the time spent reading/writing to disk? The specific application is Java-based (JBoss), and multi-threaded, and running as a service on Windows 7/2008 x64. The overall goal I have is determining whether and why file access is a bottleneck in my application. Therefore, running the application in a defined and repeatable scenario is a given. File access may be local as well as on network shares. Windows performance monitor appears to be too hard to use (unless someone can point me to a helpful explanation). Any ideas?

    Read the article

  • jquery background image fade

    - by Nick
    I am using jQuery to load ina background image that fills the page width / height. I have the following in the Head: $(document).ready(function() { $('body').css({ 'background-image' : 'url({HTML_BASE}images/backgrounds/randoms/{BACK_IMG})', 'background-repeat' : 'no-repeat', 'background-position' : 'center top', 'background-attachment': 'fixed', 'background-size': '100% 100%', }); $('#home-promo').innerfade({ speed: 'slow', timeout: 5000, type: 'sequence', containerheight: 'auto' }); $('.model-search').innerfade({ speed: 'slow', timeout: 5000, type: 'sequence', containerheight: '393' }); }); This works fine and can be seen at http://projects.snowshtechnologies.com/golden_dragon/home/ I want the BG image to fade in from the black background colour. I have looked at a few other threads on Stack that suggest its not possible as a body element defined in css, but in this scenario the BG image is being loaded in by jQuery. How would I go about adding a fade in to this code to bring the image in with a nice fadein?

    Read the article

  • OpenGL in Visual studio - Issues with GLEW

    - by BalsamicVinegar
    I'm currently following the openglbook.com tutorials (set up) (Tutorial) and have run into an issue fairly early on. I'm getting the following two errors: 1>main.obj : error LNK2019: unresolved external symbol __imp__glewGetErrorString@4 referenced in function _Initialize 1>main.obj : error LNK2019: unresolved external symbol __imp__glewInit@0 referenced in function _Initialize I have downloaded and compiled freeglut 2.8.0 as well as the glew 1.9.0 binaries. I have copied the libs and includes to C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Lib and Include respectively. The Lib and Include paths have also been added to my project properties under Additional Library/Include directories. I have also defined glew32.lib and freeglut.lib in my linker-Input-Additional dependencies. I have included and at the top of my main file. What am I missing? Every other thread I've found has been solved by adding the directories to the project properties. Does anyone have any ideas?

    Read the article

  • Why are types found on an imported namepace but not on a fully qualified namespace after retargeting the framework?

    - by Paul Ferguson
    We've just re-targeted a VB.NET project from .Net 2.0 to 3.5. Various framework types are now missing from our project. Wherever the type is referenced using a fully qualified namespace it's missing. If the relevant namespace is imported for the type; it's found. For example, this doesn't find the type Object, with compiler error "System.Object is not defined.": Public Class Foo Inherits System.Object End Class However, this works ok: Imports System Public Class Foo Inherits [Object] End Class I've already tried re-opening the solution with no success.

    Read the article

  • How to write a value validation method for core data?

    - by mystify
    The docs say: you should implement methods of the form validate:error:, as defined by the NSKeyValueCoding protocol so lets say I have an attribute which is an int: friendAge I want to make sure that any friend may not be younger than 30. So how would I make that validation method? -validateFriendAge:error: What am I gonna do in there, exactly? And what shall I do with that NSError I get passed? I think it has an dictionary where I can return a humanly readable string in an arbitrary language (i.e. the one that's used currently), so I can output a reasonable error like: "Friend is not old enough"... how to do that?

    Read the article

  • No action responded to search

    - by gazza58
    i have defined a method called 'search' in my RecipesController which is not private. in routes.rb i have the following: map.connect 'recipes/search', :controller => :recipes, :action => :search i get the following error: No action responded to search. Actions: ... where my method 'search' does not appear in the actions list. if i change the method name from 'search' to 'searchthings' and the action in routes to 'searchthings' then this seems to work. what am i missing here?

    Read the article

  • How do I parse a templated string in Python?

    - by mLewisLogic
    I'm new to Python, so I'm not sure exactly what this operation is called, hence I'm having a hard time searching for information in it. Basically I'd like to have a string such as: "[[size]] widget that [[verb]] [[noun]]" Where size, verb, and noun are each a list. I'd like to interpret the string as a metalanguage, such that I can make lots of sentences out permutations from the lists. As a metalanguage, I'd also be able to make other strings that use those pre-defined lists to generate more permutations. Are there any capabilities for variable substitution like this in Python? What term describes this operation if I should just Google it?

    Read the article

  • What is a good solution to link different tables in Hibernate based on some field value?

    - by serg555
    I have article table and several user tables a_user, b_user, ... with exactly the same structure (but different data). I can't change anything in *_user tables except their table name prefix but can change everything else (user tables contain only user information, there is nothing about article or user_type in them). I need to link article to a user (many-to-one), but user table name is defined by user_type field. For example Article table record: ... user_id="5" user_type="a" means that it is linked to a user with id=5 from a_user table (id 5 is not unique in users scope, each user table can have its id 5). Any suggestions how to handle this situation? How can I map this relation in Hibernate (xml mapping, no annotations) so it will automatically pick up correct user for an article during select/update? How should I map user tables (one or multiple classes?)? I would need to run some queries like this: from Article a where a.userType=:type and a.user.name=:name Thanks.

    Read the article

  • Is 'bool' a basic datatype in C++ ?

    - by Naveen
    I got this doubt while writing some code. Is 'bool' a basic datatype defined in the C++ standard or is it some sort of extension provided by the compiler ? I got this doubt because Win32 has 'BOOL' which is nothing but a typedef of long. Also what happens if I do something like this: int i = true; Is it "always" guaranteed that variable i will have value 1 or is it again depends on the compiler I am using ? Further for some Win32 APIs which accept BOOL as the parameter what happens if I pass bool variable?

    Read the article

  • Fastest way for inserting very large number of records into a Table in SQL

    - by Irchi
    The problem is, we have a huge number of records (more than a million) to be inserted into a single table from a Java application. The records are created by the Java code, it's not a move from another table, so INSERT/SELECT won't help. Currently, my bottleneck is the INSERT statements. I'm using PreparedStatement to speed-up the process, but I can't get more than 50 recods per second on a normal server. The table is not complicated at all, and there are no indexes defined on it. The process takes too long, and the time it takes will make problems. What can I do to get the maximum speed (INSERT per second) possible? Database: MS SQL 2008. Application: Java-based, using Microsoft JDBC driver.

    Read the article

  • NoSuchMethodException while using JAVA Reflection

    - by Appps
    Hi I'm trying to use reflection to invoke a method and update the setter value of that method. But I'm getting NoSuchMethodException while ivoking that method. com.test.Test.setAddress1(java.lang.Double) .But I've this method defined in my Class. Is the problem with my code. Can someone please help me? Thanks in advance. I've my code below. Class[] doubleArrayParamTypes = new Class[ 1 ]; doubleArrayParamTypes[ 0 ] = Double.class; Class class=Class.forName( "com.test.Test"); Object voObject = class.newInstance(); String data="TestData"; performMapping(class,"setAddress1",doubleArrayParamTypes ,voObject,data); /* Reflection to set the data */ private void performMapping(Class class,String methodName,Class[] clazz,Object voObject,Object data) { class.getMethod( "set" + methodName, clazz ).invoke( voObject, data ); }

    Read the article

  • Apple Mac Software Development

    - by MattMorgs
    I'm planning on developing an Apple Mac application which will collect hardware information from the host Mac and also installed software info. The hardware and software info will be collected in an encrypted XML file and then posted back to a website. The application should run as a "service" or background process on the Mac and can be configured to collect the data on a frequent basis defined by another encrypted XML config file. I've done plenty of Windows based software development but never on the Mac. Can anybody point me in the direction of any useful info on how to develop on the Mac, collect hardware and software info, export to an XML file, file encryption and packaging a compiled app to run as a service? Is either Objective C, Cocoa or Ruby a possible option? Many thanks for your help in advance!

    Read the article

  • Question about C# 4.0's generics covariance

    - by devoured elysium
    Having defined this interface: public interface IInputBoxService<out T> { bool ShowDialog(); T Result { get; } } Why does the following code work: public class StringInputBoxService : IInputBoxService<string> { ... } ... IInputBoxService<object> service = new StringInputBoxService(); and this doesn't?: public class IntegerInputBoxService : IInputBoxService<int> { ... } ... IInputBoxService<object> service = new IntegerInputBoxService(); Does it have anything to do with int being a value type? If yes, how can I circumvent this situation? Thanks

    Read the article

  • ASP.Net layered communication

    - by Chris Klepeis
    Hi, We're developing a layered web application. The specs: 3 layers, data layer, business layer, ui layer. Programmed in C# Data Layer uses the entity framework Currently we plan on having the data layer return IEnumerable<T> to the business layer via linq 2 entities, and the business layer will return data to the ui layer. Since the ui layer has no knowledge of the existance of the data layer, how would it handle a result of IEnumerable passed to it from the BLL, where T is defined in the data layer? Are there any GOOD example out there on how to do this. Please note that I'm extremely new to factories / interfaces / abstraction to loosely couple layers. I saw the question here http://stackoverflow.com/questions/917457/passing-data-in-an-ntier-application and it was recommended to have the entity layer shared amongst all layers... however I do not want the other layers to be able to query the database.

    Read the article

  • File System Types in .Net

    - by Avi
    I don't get the abstractions and the terminology :-( For example, DirectoryInfo.FullName is defined as the full path of the directory or file, but it's a string! So is DirectoryInfo.Name, FileInfo.FullName, Path.GetDirectoyName and so on. This means that in .Net there is no "depth" (or "meat" - my English isn't so good) for the file system objects. There's no protection from a type system. I can't, for example, define two Path objects and ask if one of them is "above" the other - I have to manipulate the strings. I can't differentiate between a Path that identifies a directory and a path that identifies a file. I can't do anything!-( Just manipulate strings. Is this correct (or am I simply missing something). If correct, are there any alternatives?

    Read the article

  • Listing known CSS classes using Javascript

    - by Fred Oliveira
    I'm trying to find a good way to collect the names of classes defined in the stylesheets included with a given document. I know about document.StyleSheetList but it doesn't seem like it'd be easy to parse. What I'm looking for is something like, for a stylesheet document such as: .my_class { background: #fff000; } .second_class { color: #000000; } I could extract an array like ["my_class", "second_class"]. This obviously assumes the favorable scenario of a fully loaded dom and stylesheets. I've been looking everywhere for a good way to do something like this and so far, have made little progress. Does anyone have any idea about how to pull this off? Thanks!

    Read the article

  • Using my ISerializable implementation instead of DataContractSerializer

    - by mpm
    My WCF client and server exchange objects whose types are defined on a class library shared by both, the server and the client. These objects implement custom serialization via ISerializable. However, my custom serialization is not being used. DataContractSerializer is being used, instead. How do I force my custom serialization to be used? The reason why I need to use my own serialization is because I do trasfer some big object graphs and my serialization algorithm does a good job in compressing/speeding up things.

    Read the article

  • C - add elements to struct by define

    - by CodeStepper
    I have a problem. I'm trying to add struct elements by previously defined constant. This is sample code (OpenGL+WinAPI) #define ENGINE_STRUCT \ HGLRC RenderingContext;\ HDC DeviceContext; And then: typedef struct SWINDOW { ENGINE_STRUCT HWND Handle; HINSTANCE Instance; CHAR* ClassName; BOOL Fullscreen; BOOL Active; MSG Message; } WINDOW; Is this possible? Thanks in advance.

    Read the article

  • Is directly executing SQL bad app design?

    - by Michael Lowman
    I'm developing an iOS application that's a manager/viewer for another project. The idea is the app will be able to process the data stored in a database into a number of visualizations-- the overall effect being similar to cacti. I'm making the visualizations fully user-configurable: the user defines what she wants to see and adds restrictions. She might specify, for instance, to graph a metric over the last three weeks with user accounts that are currently active and aren't based in the United States. My problem is that the only design I can think of is more or less passing direct SQL from the iOS app to the backend server to be executed against the database. I know it's bad practice and everything should be written in terms of stored procedures. But how else do I maintain enough flexiblity to keep fully user-defined queries? While the application does compose the SQL, direct SQL is never visible or injectable by the user. That's all abstracted away in UIDateTimeChoosers, UIPickerViews, and the like.

    Read the article

  • Assign TableView column binding to a specific core-data object in to-many related entity based on se

    - by snown27
    How would I assign a column of a TableView to be a specific entry in a Core Data entity that is linked to the NSArrayController via a to-many relationship? For example Entity: MovieEntity Attributes: title(NSString), releaseDate(NSDate) Relationship: posters<-->> PosterEntity Entity:PosterEntity Attributes: imageLocation(NSURL), default(BOOL) Relationships: movie<<--> MovieEntity So I have a three column table that I want to display the Poster, Title, and Release Date attributes in, but as one movie could potentially have several different style's of posters how do I get the poster column to only show the one that's marked default? Since the rest of the table is defined in Interface Builder I would prefer to keep it that way for the sake of keeping the code as clean as possible, but if this can only be done programmatically then I'm all ears. I just wanted to give preference in case there's more than one way to skin a cat, so to speak.

    Read the article

< Previous Page | 194 195 196 197 198 199 200 201 202 203 204 205  | Next Page >