Daily Archives

Articles indexed Thursday May 20 2010

Page 20/120 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • S#harp architecture mapping many to many and ado.net data services: A single resource was expected f

    - by Leg10n
    Hi, I'm developing an application that reads data from a SQL server database (migrated from a legacy DB) with nHibernate and s#arp architecture through ADO.NET Data services. I'm trying to map a many-to-many relationship. I have a Error class: public class Error { public virtual int ERROR_ID { get; set; } public virtual string ERROR_CODE { get; set; } public virtual string DESCRIPTION { get; set; } public virtual IList<ErrorGroup> GROUPS { get; protected set; } } And then I have the error group class: public class ErrorGroup { public virtual int ERROR_GROUP_ID {get; set;} public virtual string ERROR_GROUP_NAME { get; set; } public virtual string DESCRIPTION { get; set; } public virtual IList<Error> ERRORS { get; protected set; } } And the overrides: public class ErrorGroupOverride : IAutoMappingOverride<ErrorGroup> { public void Override(AutoMapping<ErrorGroup> mapping) { mapping.Table("ERROR_GROUP"); mapping.Id(x => x.ERROR_GROUP_ID, "ERROR_GROUP_ID"); mapping.IgnoreProperty(x => x.Id); mapping.HasManyToMany<Error>(x => x.Error) .Table("ERROR_GROUP_LINK") .ParentKeyColumn("ERROR_GROUP_ID") .ChildKeyColumn("ERROR_ID").Inverse().AsBag(); } } public class ErrorOverride : IAutoMappingOverride<Error> { public void Override(AutoMapping<Error> mapping) { mapping.Table("ERROR"); mapping.Id(x => x.ERROR_ID, "ERROR_ID"); mapping.IgnoreProperty(x => x.Id); mapping.HasManyToMany<ErrorGroup>(x => x.GROUPS) .Table("ERROR_GROUP_LINK") .ParentKeyColumn("ERROR_ID") .ChildKeyColumn("ERROR_GROUP_ID").AsBag(); } } When I view the Data service in the browser like: http://localhost:1905/DataService.svc/Errors it shows the list of errors with no problems, and using it like http://localhost:1905/DataService.svc/Errors(123) works too. The Problem When I want to see the Errors in a group or the groups form an error, like: "http://localhost:1905/DataService.svc/Errors(123)?$expand=GROUPS" I get the XML Document, but the browser says: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. -------------------------------------------------------------------------------- Only one top level element is allowed in an XML document. Error processing resource 'http://localhost:1905/DataServic... <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> -^ I view the sourcecode, and I get the data. However it comes with an exception: <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <code></code> <message xml:lang="en-US">An error occurred while processing this request.</message> <innererror xmlns="xmlns"> <message>A single resource was expected for the result, but multiple resources were found.</message> <type>System.InvalidOperationException</type> <stacktrace> at System.Data.Services.Serializers.Serializer.WriteRequest(IEnumerator queryResults, Boolean hasMoved)&#xD; at System.Data.Services.ResponseBodyWriter.Write(Stream stream)</stacktrace> </innererror> </error> A I missing something??? Where does this error come from?

    Read the article

  • How To Left Align List Items when Unordered List is Centered on the Page

    - by tonsils
    Hi, I have a div that holds an unordered list with several list items. I am using ie6 and am basically trying to center the unordered list on the screen but at the same time want the actual list item text aligned to the left. At the moment, I have my unordered list within the center tags, which has centered the list but I would actually like to now left align the actual list item text. Can someone pls assist as I am unable to left the align the text now? Thanks.

    Read the article

  • php,unix command ,imagick help me

    - by jagadeeshbalu
    This command add the text "flower" to the image: convert flower.jpg -font courier -fill white -pointsize 20 -annotate +50+50 'Flower' flower_annotate1.jpg I'm using ImageMagick 2.2.0. I'm running it from PHP using: system('convert flower.jpg -font courier -fill white -pointsize 20 -annotate +50+50 'Flower' flower_annotate1.jpg'); but I'm not getting the result

    Read the article

  • Access WindowedApplication from package class.

    - by Senling
    Hi, I'm developing an AIR application, where i need to access WindowedApplication's function from the package class. This is the Main application (Partial code) import mx.events.CloseEvent; import messages.MessageWindow public function undock():void { stage.nativeWindow.visible = true; stage.nativeWindow.orderToFront(); //Clearing the bitmaps array also clears the applcation icon from the systray NativeApplication.nativeApplication .icon.bitmaps = []; } ]] Package: (Partial code) package messages { public class MessageWindow extends NativeWindow { public function MessageWindow():void { stage.addEventListener(MouseEvent.MOUSE_DOWN,onClick); } private function onClick(event:MouseEvent):void { ****** Need to call the undock method from here. ***** } } } Is it possible to call this way or suggest any other solution Thanks in advance Senling.

    Read the article

  • Exception converting Office files to PDF using ABCpdf.NET onWindows Server 2008

    - by drivendevelopment
    Has anyone delt with this exception from ABCpdf? We're running on Server 2008 and only have issues converting Office files (Word and Excel). This all worked well on Server 2003. Because we're only having issues with Office files I wonder if it's related to the XPS support on Server 2008? The code that calls into this function is running as a Windows Service. Private Overloads Function ConvertMicrosoftOfficeDocToPdf(ByVal inputFile As Byte(), ByVal fileExt As String) As Byte() Dim abcDoc As WebSupergoo.ABCpdf7.Doc = Nothing Try abcDoc = New WebSupergoo.ABCpdf7.Doc() Dim xro As New WebSupergoo.ABCpdf7.XReadOptions() xro.FileExtension = fileExt Try abcDoc.Read(inputFile, xro) Catch ex As Exception System.Diagnostics.Trace.Write(ex.ToString()) Throw ex End Try Dim fileBytes As Byte() = abcDoc.GetData() Return fileBytes Finally If Not abcDoc Is Nothing Then abcDoc.Clear() abcDoc.Dispose() End If End Try End Function WebSupergoo.ABCpdf7.Internal.PDFException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. --- System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at WebSupergoo.ABCpdf7.Internal.NDoc._InvokeMethod(IntPtr inDoc, Int32 inMethod, Int32 inIndex, Int32 inFlags, String inParams, String& outErr) at WebSupergoo.ABCpdf7.Internal.NDoc.InvokeMethod(IntPtr inDoc, Int32 inMethod, Int32 inIndex, Int32 inFlags, String inParams, String& outErr) at WebSupergoo.ABCpdf7.Doc.PrintToXps(String inputFile, String outputFile, Int32 timeout, String printerName) at WebSupergoo.ABCpdf7.Operations.XpsImportOperation.ImportAny(Doc doc, String path, Int32 timeout) at WebSupergoo.ABCpdf7.XReadOptions.ImportXpsAny(Doc doc, String path, Boolean clear) at WebSupergoo.ABCpdf7.XReadOptions.Read(Doc doc, Byte[] data, ReadModuleType module) at WebSupergoo.ABCpdf7.XReadOptions.Read(Doc doc, Byte[] data)

    Read the article

  • Default.png images and iPad.

    - by Leg10n
    I'm about to submit my first iPad app, and I have 2 questions regarding to Default.png images. I would prefer a "splash screen" showing some artwork of my app, instead of the UI as if it was loaded, the app is a bit heavy and I've seen the users dispair when the UI is apparently loaded but it's not working. Does anyone know if apple is accepting apps with "splash screens"? I want to provide a Default-X.png for every orientation, I've read the iPad programming guide, my question is, is "Default-LandscapeLeft" a Default image rotated 90 degrees clockwise, and "Default-LandscapeRight" rotated 90 degrees counter clockwise? I'm asking this because I don't have an iPad yet to test this on. Thank you a lot in advance.

    Read the article

  • How to scale thumbnail to fit depending on tall or wide photo - Attachment_fu

    - by adamwstl
    I'm using attachment_fu and Rmagick to create thumbnails after upload. The thumbnail is a fixed 135 x 135 px and I'm currently forcing the width to 135px on all photos. The problem is that if it's a wide and fat photo is has to stretch the height awkwardly. Current Attachment_fu setup class PhotoImage < Image belongs_to :photo has_attachment :content_type => :image, :size => 0..5.megabytes, :storage => :s3, :resize_to => '650x>', :thumbnails => { :thumbnail => '135x>' }#:geometry => 'x50' } validates_as_attachment end Here's what I'm trying to do: Thanks

    Read the article

  • Can I make the Courier email server use a non-default salt for passwords?

    - by Vasiliy Stavenko
    I'm setting up email server for the first time and confused with strange thing. I have several user accounts which stored in previous server. Passwords for this accounts are in plain text. But I want to create crypts for them. MySQL (where my users will be stored) have function encrypt(passwd, salt). If no salt given used random value. I discovered that Courier uses one certain salt and crypted all passwords with it. So the task done. But I'd like to know if there's a way to define my own salt for my pop3 server?

    Read the article

  • I Get the error message while write data in file --Cannot access the disposable object .Object name

    - by kunal rai
    This was the code: public static void SaveFile(Stream stream, string fileName = "") { using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication()) { IsolatedStorageFileStream fs = file.CreateFile(fileName); var filesize = stream.Length; var getContent = new byte[(int)filesize]; stream.Read(getContent, 0, (int)filesize); fs.Write(getContent, 0, (int)filesize); fs.Close(); } }

    Read the article

  • Problem in getting Contact Info

    - by Rahul
    Hi, I m working on application in which i have to send all contacts from Android mobile to other mobile through SMS. I don't have any problem in getting contact information but when I send those Contacts after few messages there is Alert Window pop up saying "A large number of message have being send" and ask if you want to send or not. I am testing this application on HTC Hero. Is this problem is for specific mobiles or for all? I don't know what should i do to avoid this window because I cant get SMS Sent event. Please help me with any ideas that i can implement........ Thanks

    Read the article

  • Execute another program in multi-threaded program

    - by Gary
    Hi, Just wondering how if it's possible to execute another program in a thread and send information to/get information from it. Essentially the same concept as with a child process and using pipes to communicate - however I don't want to use fork. I can't seem to find whether it's possible to do this, any help would be appreciated. Thanks

    Read the article

  • Converting numbers to their language, how?

    - by SoLoGHoST
    Ok, I'm using mathematical equations to output numbers, though, I need this to be compatible for all languages. Currently, all language strings are within a php array called $txt, and each key of the array gets called for that language. I'm outputting the following: Column 1, Column 2, Column 3, and so on, as well as Row 1, Row 2, Row 3, and so on. The calculations are done via php and javascript, so I'm wondering on the best approach for how to support all languages for the numbers only. I don't do the translations, someone else does, but I need to be able to point it to, either the php variable $txt of where the language is defined, or, since the calculations are done via javascript also, I need to somehow store this in there. I'm thinking of storing something like this: // This part goes in the php language file. $txt['0'] = '0'; $txt['1'] = '1'; $txt['2'] = '2'; $txt['2'] = '3'; $txt['4'] = '4'; $txt['5'] = '5'; $txt['6'] = '6'; $txt['7'] = '7'; $txt['8'] = '8'; $txt['9'] = '9'; // This part goes in the php file that needs to call the numbers. echo '<script> var numtxts = new Array(); numtxts[0] = \'', $txt['0'], '\'; numtxts[1] = \'', $txt['1'], '\'; numtxts[2] = \'', $txt['2'], '\'; numtxts[3] = \'', $txt['3'], '\'; numtxts[4] = \'', $txt['4'], '\'; numtxts[5] = \'', $txt['5'], '\'; numtxts[6] = \'', $txt['6'], '\'; numtxts[7] = \'', $txt['7'], '\'; numtxts[8] = \'', $txt['8'], '\'; numtxts[9] = \'', $txt['9'], '\'; </script>'; And than in the javascript function it could grab the correct string for each number like so: // Example Number String below. var numString = "10"; var transNum = ""; for(x=0;x<numString.length;x++) { var numChar = numString.charAt(x); transNum += numtxts[parseInt(numChar)]; } return transNum; The problem with this bit of code is that it groups the numbers, not sure if all languages do that, like the english language does...? Perhaps there's a better approach for this? Can anyone help please? Thanks :)

    Read the article

  • How do I set my development web browser in VS2010?

    - by blesh
    I don't like to use IE for my system default web browser. but I do want to set IE as my browser in VS2010 because it works a little nicer for debugging and I like to develop to the lowest common denominator. (jab, lol)... anyhow, can I default to debugging against IE? I know in VS2008 you just had to "Browse With..." on an .aspx page. But that option doesn't exist in VS2010 RC. What gives?

    Read the article

  • directory_map() not working outside of application

    - by iamdadude
    Is there a reason as to why $map = directory_map('./', TRUE); works perfectly and, $map = directory_map('../', TRUE); doesn’t work at all? I tried creating a directory with the basic mkdir(); PHP function (http://php.net/mkdir) and it didn’t work either. Can anyone set me in the right direction as to what I’m doing wrong and how I can fix it? Thanks!

    Read the article

  • WCF with SSL- not finding localhost

    - by SteveCav
    Hi guys, I'm trying to get WCF to use SSL with ANYTHING for FIVE DAYS now. I've gone through countless walkthroughs, generated more certificates than a mail order diploma company, even tried hot fixes. After working with MS dev tools since VB1, I am now considering flipping burgers as a career option. WCF, as far as I can see, is a complete lemon. Anyway, to get to my actual question: If I run through this walkthrough: http://msdn.microsoft.com/en-us/library/ff648840.aspx I get to step 11 (adding the service reference) and get "There was an error downloading metadata from the address. Please verify that you have entered a valid address". Details of the error gives: There was an error downloading 'https://localhost/SSL6/Service.svc'. Unable to connect to the remote server No connection could be made because the target machine actively refused it 127.0.0.1:443 I'm using VS2008 on Windows 7 with IIS7. I followed the walkthrough exactly (apart from step 5 which was different on IIS7- I went into "SSL Settings" for the VD), so it shows my config (yes I've used httpsGetEnabled and mexHttpsBinding). Anyone care to save my sanity and job?

    Read the article

  • C# work with functions

    - by gloris
    Hi, I'am new with C#. How works in C# functions? My try: private void Form1_Load(object sender, EventArgs e) { MessageBox.Show(Convert.ToString(number_p(5))); } public void number_p(int number) { int one = 1; number = number + one; return number; } Error: return, why? Thanks

    Read the article

  • Array of Arrays - writing to File problem

    - by iFloh
    Hi, and again my array of arrays ... I try to improve my app performance by buffering arrays on file for later reuse. I have an NSMutableArray that contains about 30 NSMutableArrays with NSNumber, NSDate and NSString Objects. I try to write the file using this call: bool result = [myArray writeToFile:[fileMethods getFullPath:[NSString stringWithFormat:@"iEts%@.arr", [aDate shortDateString]]] atomically:NO]; = result = FALSE. The Path method is: + (NSString *) getFullPath:(NSString *)forFileName { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; return [documentsDirectory stringByAppendingPathComponent:forFileName]; } and the aDate call returns a shortDateString with ddMMyy. The NSLog NSLog(@"%@", [fileMethods getFullPath:[NSString stringWithFormat:@"iEts%@.arr", [aDate shortDateString]]]); on the path generation returns: /Users/me/Library/Application Support/iPhone Simulator/User/Applications/86729620-EC1D-4C10-A799-0C638BB27933/Documents/iEts010510.arr FURTHER: It must have something to do with the Array of Arrays, since I also write 3 further simple arrays (containing NSStrings) that all succeed. The Array of Arrays gets generated using the addObject method Any ideas what could cause the trouble?

    Read the article

  • How to document an accessor/mutator method in phpDoc/javaDoc?

    - by nickf
    Given a function which behaves as either a mutator or accessor depending on the arguments passed to it, like this: // in PHP, you can pass any number of arguments to a function... function cache($cacheName) { $arguments = func_get_args(); if (count($arguments) >= 2) { // two arguments passed. MUTATOR. $value = $arguments[1]; // use the second as the value $this->cache[$cacheName] = $value; // *change* the stored value } else { // 1 argument passed, ACCESSOR return $this->cache[$cacheName]; // *get* the stored value } } cache('foo', 'bar'); // nothing returned cache('foo') // 'bar' returned How do you document this in PHPDoc or a similar automated documentation creator? I had originally just written it like this: /** * Blah blah blah, you can use this as both a mutator and an accessor: * As an accessor: * @param $cacheName name of the variable to GET * @return string the value... * * As a mutator: * @param $cacheName name of the variable to SET * @param $value the value to set * @return void */ However, when this is run through phpDoc, it complains because there are 2 return tags, and the first @param $cacheName description is overwritten by the second. Is there a way around this?

    Read the article

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