Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

Page 94/604 | < Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >

  • Why does passing arguments to the command in an env invocation not work?

    - by timdisney
    I have a shell script to run node with some arguments like so: #!/usr/bin/env node --harmony_proxies ... This works fine under OS X but in Ubuntu it errors with: /usr/bin/env: node --harmony_proxies: No such file or directory Node is definitely installed and on the PATH since if I remove the --harmony_proxies flag it works fine. Is there some different way of passing arguments when using env in Ubuntu?

    Read the article

  • When using membership provider, do you use the user ID or the username?

    - by Chris
    I've come across this is in a couple of different applications that I've worked on. They all used the ASP.NET Membership Provider for user accounts and controlling access to certain areas, but when we've gotten down into the code I've noticed that in one we're passing around the string based user name, like "Ralph Waters", or we're passing around the Guid based user ID from the membership table. Now both seem to work. You can make methods which get by username, or get by user ID, but both have felt somewhat "funny". When you pass a string like "Ralph Waters" you're passing essentially two separate words that make up a unique identifier. And with a Guid, you're passing around a string/number combination which can be cast and made unique. So my question is this; when using Membership Provider, which do you use, the username or the user ID to get back to the user? Thanks all!

    Read the article

  • SQL SERVER – Fix: Error: 147 An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference

    - by pinaldave
    Everybody was beginner once and I always like to get involved in the questions from beginners. There is a big difference between the question from beginner and question from advanced user. I have noticed that if an advanced user gets an error, they usually need just a small hint to resolve the problem. However, when a beginner gets error he sometimes sits on the error for a long time as he/she has no idea about how to solve the problem as well have no idea regarding what is the capability of the product. I recently received a very novice level question. When I received the problem I quickly see how the user was stuck. When I replied him with the solution, he wrote a long email explaining how he was not able to solve the problem. He thanked multiple times in the email. This whole thing inspired me to write this quick blog post. I have modified the user’s question to match the code with AdventureWorks as well simplified so it contains the core content which I wanted to discuss. Problem Statement: Find all the details of SalesOrderHeaders for the latest ShipDate. He comes up with following T-SQL Query: SELECT * FROM [Sales].[SalesOrderHeader] WHERE ShipDate = MAX(ShipDate) GO When he executed above script it gave him following error: Msg 147, Level 15, State 1, Line 3 An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference. He was not able to resolve this problem, even though the solution was given in the query description itself. Due to lack of experience he came up with another version of above query based on the error message. SELECT * FROM [Sales].[SalesOrderHeader] HAVING ShipDate = MAX(ShipDate) GO When he ran above query it produced another error. Msg 8121, Level 16, State 1, Line 3 Column ‘Sales.SalesOrderHeader.ShipDate’ is invalid in the HAVING clause because it is not contained in either an aggregate function or the GROUP BY clause. What he wanted actually was the SalesOrderHeader all the Sales shipped on the last day. Based on the problem statement what the right solution is as following, which does not generate error. SELECT * FROM [Sales].[SalesOrderHeader] WHERE ShipDate = (SELECT MAX(ShipDate) FROM [Sales].[SalesOrderHeader]) Well, that’s it! Very simple. With SQL Server there are always multiple solution to a single problem. Is there any other solution available to the problem stated? Please share in the comment. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • publishing asp.net website give "Object reference not set to an instance of an object." error

    - by Johan
    Good day I am using VS 2008 I am getting fed up with this error. I have search all over the web and tried every possible suggestion to this error I could find. 1. delete app_code, build, add files back, publish. (did not work) 2. delete temporary asp.net files (did not work) in the end I even tried the command line and get the following stacktrace. error ASPRUNTIME: Object reference not set to an instance of an object. [NullReferenceException]: Object reference not set to an instance of an object. at System.Web.Compilation.BuildManager.CopyPrecompiledFile(VirtualFile vfile, String destPhysicalPath) at System.Web.Compilation.BuildManager.CopyStaticFilesRecursive(VirtualDirect ory sourceVdir, String destPhysicalDir, Boolean topLevel) at System.Web.Compilation.BuildManager.CopyStaticFilesRecursive(VirtualDirect ory sourceVdir, String destPhysicalDir, Boolean topLevel) at System.Web.Compilation.BuildManager.CopyStaticFilesRecursive(VirtualDirect ory sourceVdir, String destPhysicalDir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath star tingVirtualDir) at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirt ualDir) at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallba ck callback) at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCa llback callback) at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCa llback callback) at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuil dManagerCallback callback, Boolean forceCleanBuild) at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuil dManagerCallback callback) at System.Web.Compilation.Precompiler.Main(String[] args) I used the following command line: aspnet_compiler.exe -p d:\code\websites\brokerweb -v / d:\code\websites\published -f -c -errorstack -u Please help as I cannot publish this site at all at present and it worked fine for quite a long time now before this stupid error. Regards Johan

    Read the article

  • WPF binding to ComboBox SelectedItem when reference not in ItemsSource.

    - by juharr
    I'm binding the PageMediaSize collection of a PrintQueue to the ItemSource of a ComboBox (This works fine). Then I'm binding the SelectedItem of the ComboBox to the DefaultPrintTicket.PageMediaSize of the PrintQueue. While this will set the selected value to the DefaultPrintTicket.PageMediaSize just fine it does not set the initially selected value of the ComboBox to the initial value of DefaultPrintTicket.PageMediaSize This is because the DefaultPrintTicket.PageMediaSize reference does not match any of the references in the collection. However I don't want it to compare the objects by reference, but instead by value, but PageMediaSize does not override Equals (and I have no control over it). What I'd really like to do is setup a IComparable for the ComboBox to use, but I don't see any way to do that. I've tried to use a Converter, but I would need more than the value and I couldn't figured out how to pass the collection to the ConverterProperty. Any ideas on how to handle this problem. Here's my xaml <ComboBox x:Name="PaperSizeComboBox" ItemsSource="{Binding ElementName=PrintersComboBox, Path=SelectedItem, Converter={StaticResource printQueueToPageSizesConverter}}" SelectedItem="{Binding ElementName=PrintersComboBox, Path=SelectedItem.DefaultPrintTicket.PageMediaSize}" DisplayMemberPath="PageMediaSizeName" Height="22" Margin="120,76,15,0" VerticalAlignment="Top"/> And the code for the converter that gets the PageMediaSize collection public class PrintQueueToPageSizesConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value == null ? null : ((PrintQueue)value).GetPrintCapabilities().PageMediaSizeCapability; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } }

    Read the article

  • Using Directives, Namespace and Assembly Reference - all jumbled up with StyleCop!

    - by Jack
    I like to adhere to StyleCop's formatting rules to make code nice and clear, but I've recently had a problem with one of its warnings: All using directives must be placed inside of the namespace. My problem is that I have using directives, an assembly reference (for mocking file deletion), and a namespace to juggle in one of my test classes: using System; using System.IO; using Microsoft.Moles.Framework; using Microsoft.VisualStudio.TestTools.UnitTesting; [assembly: MoledType(typeof(System.IO.File))] namespace MyNamespace { //Some Code } The above allows tests to be run fine - but StyleCop complains about the using directives not being inside the namespace. Putting the usings inside the namespace gives the error that "MoledType" is not recognised. Putting both the usings and the assembly reference inside the namespace gives the error 'assembly' is not a valid attribute location for this declaration. Valid attribute locations for this declaration are 'type'. All attributes in this block will be ignored. It seems I've tried every layout I can but to no avail - either the solution won't build, the mocking won't work or StyleCop complains! Does anyone know a way to set these out so that everything's happy? Or am I going to have to ignore the StyleCop warning in this case?

    Read the article

  • How do I reference an unsigned assembly from a VSTO Word Doc project?

    - by Gishu
    I created a new project in VS2008. Project type Visual C# > Office > 2007 > Word 2007 Document Added some code.. got Word to do a few jumps through some custom hoops.. all fine. Now I need to reference another assembly (CopyLocal as false) which is not signed. So I add the project reference. Now the project will not build complaining error MSB3188: Assembly 'X.dll' must be strong signed in order to be marked as a prerequisite. The error code page is concise (now accustomed to this) Been googling and reading posts ever since.. No Luck. How do I get around this ? Or is the hidden commandment that all references (for VSTO?) must be strong named / signed. I cannot sign 'X.dll' and be done with it because it is a binary that I don't control also it depends on another bunch of unsigned dlls.. can't set off a chain sign reaction. Update: Solved the build issue by turning CopyLocal=True. But this meant dumping the referenced X.DLL and all its dependencies into the bin\debug folder... Ughh! Tried creating a subfolder called bin\debug\refExecs and referencing X.dll CopyLocal=false from there. The error message was back.

    Read the article

  • C#/.Net Error: MySql.Data Object reference not set to an instance of an object.

    - by Simon
    Hello, I get this exception on my Windows 7 64bit in application running in VS 2008 express. I am using Connector/Net 6.2.2.0: Message: Object reference not set to an instance of an object. Source: MySql.Data in MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) Stack trace: in MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) in MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) in MySql.Data.MySqlClient.MySqlDataReader.NextResult() in MySql.Data.MySqlClient.MySqlDataReader.Close() in MySql.Data.MySqlClient.MySqlConnection.Close() in MySql.Data.MySqlClient.MySqlConnection.Dispose(Boolean disposing) in System.ComponentModel.Component.Finalize() No inner exception. This exception is unhalted and the debugger dont point on any code line. It just say "Object reference not set to an instance of an object. MySql.Data" This error is really hard to repeat. On my Windows XP 32bit is all ok. Could it be error in 64bit Windows 7? Thank you very much for your answers. Regards, simon

    Read the article

  • Function parameters evaluation order: is undefined behaviour if we pass reference?

    - by bolov
    This is undefined behaviour: void feedMeValue(int x, int a) { cout << x << " " << a << endl; } int main() { int a = 2; int &ra = a; feedMeValue(ra = 3, a); return 0; } because depending on what parameter gets evaluated first we could call (3, 2) or (3, 3). However this: void feedMeReference(int x, int const &ref) { cout << x << " " << ref << endl; } int main() { int a = 2; int &ra = a; feedMeReference(ra = 3, a); return 0; } will always output 3 3 since the second parameter is a reference and all parameters have been evaluated before the function call, so even if the second parameter is evaluated before of after ra = 3, the function received a reference to a wich will have a value of 2 or 3 at the time of the evaluation, but will always have the value 3 at the time of the function call. Is the second example UB? It is important to know because the compiler is free to do anything if he detects undefined behaviour, even if I know it would always yield the same results. *Note: I think that feedMeReference(a = 3, a) is the exact same situation as feedMeReference(ra = 3, a). However it seems not everybody agrees, in the addition to having 2 completely different answers.

    Read the article

  • Is there a way to increase the efficiency of shared_ptr by storing the reference count inside the co

    - by BillyONeal
    Hello everyone :) This is becoming a common pattern in my code, for when I need to manage an object that needs to be noncopyable because either A. it is "heavy" or B. it is an operating system resource, such as a critical section: class Resource; class Implementation : public boost::noncopyable { friend class Resource; HANDLE someData; Implementation(HANDLE input) : someData(input) {}; void SomeMethodThatActsOnHandle() { //Do stuff }; public: ~Implementation() { FreeHandle(someData) }; }; class Resource { boost::shared_ptr<Implementation> impl; public: Resource(int argA) explicit { HANDLE handle = SomeLegacyCApiThatMakesSomething(argA); if (handle == INVALID_HANDLE_VALUE) throw SomeTypeOfException(); impl.reset(new Implementation(handle)); }; void SomeMethodThatActsOnTheResource() { impl->SomeMethodThatActsOnTheHandle(); }; }; This way, shared_ptr takes care of the reference counting headaches, allowing Resource to be copyable, even though the underlying handle should only be closed once all references to it are destroyed. However, it seems like we could save the overhead of allocating shared_ptr's reference counts and such separately if we could move that data inside Implementation somehow, like boost's intrusive containers do. If this is making the premature optimization hackles nag some people, I actually agree that I don't need this for my current project. But I'm curious if it is possible.

    Read the article

  • Drupal 6: getting particular fields from Node Reference types...

    - by artmania
    Hi friends, I'm a drupal newbie... <?php print $node->field_date[0]['view']; ?> I can get the custom created CCK fields' value and display in tpl.php files as above... that's fine. my question is how can I get the Node reference fields' in-fields? for example, I have an event content type, and I have defined Node Reference for Location (title, address, img, etc.). When I write the code below, it displays all location content; <?php print $node->field_location[0]['view']; ?> but I need to get only address field from this location content type. sth like below would be great :D but not working; <?php print $node->field_location[0]['field_address']['view']; ?> so how can get that? appreciate helps so much! thanks a lot!

    Read the article

  • Is this reference or code in mistake or bug?

    - by mikezang
    I copied some text from NSDate Reference as below, please check Return Value, it is said the format will be in YYYY-MM-DD HH:MM:SS ±HHMM, but I got as below in my app, so the reference is mistake? or code in mistake? Saturday, January 1, 2011 12:00:00 AM Japan Standard Time or 2011?1?1????0?00?00? ????? descriptionWithLocale: Returns a string representation of the receiver using the given locale. - (NSString *)descriptionWithLocale:(id)locale Parameters locale An NSLocale object. If you pass nil, NSDate formats the date in the same way as the description method. On Mac OS X v10.4 and earlier, this parameter was an NSDictionary object. If you pass in an NSDictionary object on Mac OS X v10.5, NSDate uses the default user locale—the same as if you passed in [NSLocale currentLocale]. Return Value A string representation of the receiver, using the given locale, or if the locale argument is nil, in the international format YYYY-MM-DD HH:MM:SS ±HHMM, where ±HHMM represents the time zone offset in hours and minutes from GMT (for example, “2001-03-24 10:45:32 +0600”)

    Read the article

  • Strict pointer aliasing: is access through a 'volatile' pointer/reference a solution?

    - by doublep
    On the heels of a specific problem, a self-answer and comments to it, I'd like to understand if it is a proper solution, workaround/hack or just plain wrong. Specifically, I rewrote code: T x = ...; if (*reinterpret_cast <int*> (&x) == 0) ... As: T x = ...; if (*reinterpret_cast <volatile int*> (&x) == 0) ... with a volatile qualifier to the pointer. Let's just assume that treating T as int in my situation makes sense. Does this accessing through a volatile reference solve pointer aliasing problem? For a reference, from specification: [ Note: volatile is a hint to the implementation to avoid aggressive optimization involving the object because the value of the object might be changed by means undetectable by an implementation. See 1.9 for detailed semantics. In general, the semantics of volatile are intended to be the same in C++ as they are in C. — end note ] EDIT: The above code did solve my problem at least on GCC 4.5.

    Read the article

  • Is it possible, in ASP .net, to reference private assembly in a non-virtual subdirectory?

    - by Bago
    Is it possible to reference a private assembly in asp .net from a sub-folder that is not setup as a virtual directory? In other words, my page is setup in ~/subdir, I don't have access to ~/, and I am not an IIS admin. Can I reference a private assembly? How would I do this? I've tried <%@ Assembly Src="/subdir/bin/Assembly.dll % and <%@ Assembly Src="/subdir/bin/Assembly.dll % , but I get the messages "There is no build provider to match the extension .dll" or "Failed to map to path" respectively. Here is my folder structure: / | -subdir | | - Bin | | | *Assembly.dll | | *Default.aspx I've heard that in web.config might do the trick, but when I've tried it, it doesn't seem to work. Furthermore, I've read that only works in the application .config file. (i.e., the one in ~/). Anyhow, I already tried adding the following to web.config: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="/subdir/bin" /> <dependentAssembly> <codeBase href="/subdir/bin/Assembly.dll"/> </dependentAssembly> </assemblyBinding> For more background on my problem, I am simply using a shared host, all I have is access to is that subdirectory, and I am trying to use fckeditor.

    Read the article

  • Is it possible, in ASP.net, to reference private assembly in a non-virtual subdirectory?

    - by Bago
    Is it possible to reference a private assembly in asp .net from a sub-folder that is not setup as a virtual directory? In other words, my page is setup in ~/subdir, I don't have access to ~/, and I am not an IIS admin. Can I reference a private assembly? How would I do this? I've tried <%@ Assembly Src="/subdir/bin/Assembly.dll % and <%@ Assembly Src="/subdir/bin/Assembly.dll % , but I get the messages "There is no build provider to match the extension .dll" or "Failed to map to path" respectively. Here is my folder structure: / | -subdir | | - Bin | | | *Assembly.dll | | *Default.aspx I've heard that in web.config might do the trick, but when I've tried it, it doesn't seem to work. Furthermore, I've read that only works in the application .config file. (i.e., the one in ~/). Anyhow, I already tried adding the following to web.config: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="/subdir/bin" /> <dependentAssembly> <codeBase href="/subdir/bin/Assembly.dll"/> </dependentAssembly> </assemblyBinding> For more background on my problem, I am simply using a shared host, all I have is access to is that subdirectory, and I am trying to use fckeditor.

    Read the article

  • Are vector assignments copied by value or by reference in Google's Go language?

    - by Brian T Hannan
    In the following code, I create one peg puzzle then do a move on it which adds a move to its movesAlreadyDone vector. Then I create another peg puzzle then do a move on it which adds a move to its movesAlreadyDone vector. When I print out the values in that vector for the second one, it has the move in it from the first one along with the move from the second one. Can anyone tell me why it seems to be assigning by reference and not value? Are vector assignments copied by value or by reference in Google's Go language? package main import "fmt" import "container/vector" type Move struct { x0, y0, x1, y1 int } type PegPuzzle struct { movesAlreadyDone * vector.Vector; } func (p *PegPuzzle) InitPegPuzzle(){ p.movesAlreadyDone = vector.New(0); } func NewChildPegPuzzle(parent *PegPuzzle) *PegPuzzle{ retVal := new(PegPuzzle); retVal.movesAlreadyDone = parent.movesAlreadyDone; return retVal } func (p *PegPuzzle) doMove(move Move){ p.movesAlreadyDone.Push(move); } func (p *PegPuzzle) printPuzzleInfo(){ fmt.Printf("-----------START----------------------\n"); fmt.Printf("moves already done: %v\n", p.movesAlreadyDone); fmt.Printf("------------END-----------------------\n"); } func main() { p := new(PegPuzzle); cp1 := new(PegPuzzle); cp2 := new(PegPuzzle); p.InitPegPuzzle(); cp1 = NewChildPegPuzzle(p); cp1.doMove(Move{1,1,2,3}); cp1.printPuzzleInfo(); cp2 = NewChildPegPuzzle(p); cp2.doMove(Move{3,2,5,1}); cp2.printPuzzleInfo(); } Any help will be greatly appreciated. Thanks!

    Read the article

  • why no implicit conversion from pointer to reference to const pointer.

    - by user316606
    I'll illustrate my question with code: #include <iostream> void PrintInt(const unsigned char*& ptr) { int data = 0; ::memcpy(&data, ptr, sizeof(data)); // advance the pointer reference. ptr += sizeof(data); std::cout << std::hex << data << " " << std::endl; } int main(int, char**) { unsigned char buffer[] = { 0x11, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x22, }; /* const */ unsigned char* ptr = buffer; PrintInt(ptr); // error C2664: ... PrintInt(ptr); // error C2664: ... return 0; } When I run this code (in VS2008) I get this: error C2664: 'PrintInt' : cannot convert parameter 1 from 'unsigned char *' to 'const unsigned char *&'. If I uncomment the "const" comment it works fine. However shouldn't pointer implicitly convert into const pointer and then reference be taken? Am I wrong in expecting this to work? Thanks!

    Read the article

  • How do I get a reference to a rootViewController to a sub-view?

    - by Andy
    An answer posted for one of my previous questions brings up another question; I am calling a new view controller, "RuleBuilder," from my rootViewController. The rootViewController holds a reference to a contacts array. How do I get a reference to that array into the RuleBuilder? I tried adding UITableViewController *rootViewController; ... @property (nonatomic, retain) UITableViewController *rootViewController; to RuleBuilder.h, and then @synthesize rootViewController; in RuleBuilder.m. When I instantiate and push the RuleBuilder from within rootViewController, I do this: ruleBuilder.rootViewController = self; But when I try this [rootViewController.contacts addObject:newContact]; from within RuleBuilder, I get a compiler error to the effect of "request for 'contacts' in something not a struct" (or very similar; I haven't implemented this exact snippet of code, but I tried an identical approach not an hour ago for a couple of different references that I never was able to get working). Thanks, again, for your help.

    Read the article

  • Nhibernate Migration from 1.0.2.0 to 2.1.2 and many-to-one save problems

    - by Meska
    Hi, we have an old, big asp.net application with nhibernate, which we are extending and upgrading some parts of it. NHibernate that was used was pretty old ( 1.0.2.0), so we decided to upgrade to ( 2.1.2) for the new features. HBM files are generated through custom template with MyGeneration. Everything went quite smoothly, except for one thing. Lets say we have to objects Blog and Post. Blog can have many posts, so Post will have many-to-one relationship. Due to the way that this application operates, relationship is done not through primary keys, but through Blog.Reference column. Sample mapings and .cs files: <?xml version="1.0" encoding="utf-8" ?> <id name="Id" column="Id" type="Guid"> <generator class="assigned"/> </id> <property column="Reference" type="Int32" name="Reference" not-null="true" /> <property column="Name" type="String" name="Name" length="250" /> </class> <?xml version="1.0" encoding="utf-8" ?> <id name="Id" column="Id" type="Guid"> <generator class="assigned"/> </id> <property column="Reference" type="Int32" name="Reference" not-null="true" /> <property column="Name" type="String" name="Name" length="250" /> <many-to-one name="Blog" column="BlogId" class="SampleNamespace.BlogEntity,SampleNamespace" property-ref="Reference" /> </class> And class files class BlogEntity { public Guid Id { get; set; } public int Reference { get; set; } public string Name { get; set; } } class PostEntity { public Guid Id { get; set; } public int Reference { get; set; } public string Name { get; set; } public BlogEntity Blog { get; set; } } Now lets say that i have a Blog with Id 1D270C7B-090D-47E2-8CC5-A3D145838D9C and with Reference 1 In old nhibernate such thing was possible: //this Blog already exists in database BlogEntity blog = new BlogEntity(); blog.Id = Guid.Empty; blog.Reference = 1; //Reference is unique, so we can distinguish Blog by this field blog.Name = "My blog"; //this is new Post, that we are trying to insert PostEntity post = new PostEntity(); post.Id = Guid.NewGuid(); post.Name = "New post"; post.Reference = 1234; post.Blog = blog; session.Save(post); However, in new version, i get an exception that cannot insert NULL into Post.BlogId. As i understand, in old version, for nhibernate it was enough to have Blog.Reference field, and it could retrieve entity by that field, and attach it to PostEntity, and when saving PostEntity, everything would work correctly. And as i understand, new NHibernate tries only to retrieve by Blog.Id. How to solve this? I cannot change DB design, nor can i assign an Id to BlogEntity, as objects are out of my control (they come prefilled as generic "ojbects" like this from external source)

    Read the article

  • Why is ASP.NET MVC Authorize attribute throwing a null reference exception?

    - by robertz
    I had a working asp.net mvc application running on my local IIS 7 web server, but now I'm getting errors whenever I request a page that requires authorization. I'm using standard forms authentication with asp.net membership. Here's the error: Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] System.Web.Mvc.AuthorizeAttribute.AuthorizeCore(HttpContextBase httpContext) +31 System.Web.Mvc.AuthorizeAttribute.OnAuthorization(AuthorizationContext filterContext) +38 System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +103 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +345...

    Read the article

  • I'm referencing an WiX extension in a WiX library project -- how do I avoid having to reference this

    - by arathorn
    I'm referencing a WiX extension in a WiX library project. This WiX library project is itself referenced by my main WiX MSI project. Why does the main project have to also reference the WiX extension, even though it doesn't directly need it? I'd like to keep my wixlib's as self-contained as possible, so that other projects that use them don't need to know about their inner workings. I'm using latest stable release of WiX (3.0.x).

    Read the article

  • How can I pass a reference to another control as an IValueConverter parameter?

    - by MKing
    I am binding some business objects to a WPF ItemsControl. They are displayed using a custom IValueConverter implementation used to produce the Geometry for a Path object in the DataTemplate as shown here: <ItemsControl x:Name="Display" Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding ElementName=ViewPlaneSelector, Path=SelectedItem.VisibleElements}" > <ItemsControl.Resources> <!-- This object is just used to get around the fact that ConverterParameter can't be a binding directly (it's not a DependencyProperty on a DependencyObject --> <this:GeometryConverterData x:Key="ConverterParameter2" Plane="{Binding ElementName=ViewPlaneSelector, Path=SelectedItem}" /> <DataTemplate DataType="{x:Type o:SlenderMember}"> <Path Stroke="Blue" StrokeThickness=".5" Data='{Binding Converter={StaticResource SlenderMemberConverter}, ConverterParameter={StaticResource ConverterParameter2}}' ToolTip="{Binding AsString}"> </Path> </DataTemplate> </ItemsControl.Resources> </ItemsControl> Note that the items for the ItemsControl are drawn from the ViewPlaneSelector (a ComboBox) SelectedItem.VisibleElements property. I need that same ViewPlaneSelector.SelectedItem in the SlenderMemberConverter to figure out how to display this element. I'm trying to get a reference to it into the converter by creating the intermediate GeometryConverterData object in the Resources section. This object exists solely to get around the problem of not being able to bind directly to the ConverterParameter property (as mentioned in the comments). Here is the code for the GeometryDataConverter class: class GeometryConverterData : FrameworkElement { public static readonly DependencyProperty PlaneProperty = DependencyProperty.Register("Plane", typeof(ViewPlane), typeof(GeometryConverterData), null, ValidValue); public static bool ValidValue(object o){ return true; } public ViewPlane Plane { get{ return GetValue(PlaneProperty) as ViewPlane; }set{ SetValue(PlaneProperty, value); } } } I added the ValidValue function for debugging, to see what this property was getting bound it. It only and always gets set to null. I know that the ViewPlaneSelector.SelectedItem isn't always null since the ItemsControl has items, and it's items are drawn from the same property on the same object... so what gives? How can I get a reference to this ComboBox into my ValueConverter. Or, alternately, why is what I'm doing silly and overly complicated. I'm as guilty as many of sometimes getting it into my head that something has to be done a certain way and then killing myself to make it happen when there's a much cleaner and simpler solution.

    Read the article

  • Passing parameters between interrupt handlers on a Cortex-M3 ...

    - by Captain NedD
    I'm building a light kernel for a Cortex-M3. From a high priority interrupt I'd like to invoke some code to run in a lower priority interrupt and pass some parameters along. I don't want to use a queue to post work to the lower priority interrupt. I just have a buffer and size to pass to it. In the proramming manual it says that the SVC interrupt handler is synchronous which presumably means that if you invoke it from an interrupt that's a lower priority than SVC's handler it gets called immediately (the upshot of this being that you can pass parameters to it as though it were a function call (a little like the BIOS calls in MS-DOS)). I'd like to do it the other way: passing parameters from a high priority interrupt to a lower priority one (at the moment I'm doing it by leaving the parameters in a fixed location in memory). What's the best way to do this (if at all possible)? Thanks,

    Read the article

< Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >