Daily Archives

Articles indexed Thursday May 20 2010

Page 11/120 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Silverlight webservice

    - by pistacchio
    Hi, Can webservices be accessed by Silverlight 3? On VisualStudio, a Silverlight project doesn't allow me to add a "web reference" but only a "web service reference" that is for WCF and not "normal" webservices. Any help? Thanks

    Read the article

  • Risking the exception anti-pattern.. with some modifications

    - by Sridhar Iyer
    Lets say that I have a library which runs 24x7 on certain machines. Even if the code is rock solid, a hardware fault can sooner or later trigger an exception. I would like to have some sort of failsafe in position for events like this. One approach would be to write wrapper functions that encapsulate each api a: returnCode=DEFAULT; try { returnCode=libraryAPI1(); } catch(...) { returnCode=BAD; } return returnCode; The caller of the library then restarts the whole thread, reinitializes the module if the returnCode is bad. Things CAN go horribly wrong. E.g. if the try block(or libraryAPI1()) had: func1(); char *x=malloc(1000); func2(); if func2() throws an exception, x will never be freed. On a similar vein, file corruption is a possible outcome. Could you please tell me what other things can possibly go wrong in this scenario?

    Read the article

  • How to Create an XML File from an Excel File

    - by nicorellius
    I have an Excel spreadsheet file that has 5 or so columns and hundreds of lines. I need to convert this (export these data) to an XML file. I'm interested in three of the columns and they correspond to these XML tags, where info1 can be followed by info2, info3, etc... <?xml version="1.0" encoding="UTF-8" ?> <list> <info1> <id>111</id> <value>222</value> <des>333</des> </info1> </list> If possible, I would like to avoid building this XML manually. It wouldn't be too much trouble to rearrange the Excel file such that the three columns I'm interested in were in their own file. But then I would need to export those data into an XML file of the above format. Any ideas?

    Read the article

  • MS Access MSChart.Graph.8 not printing

    - by Tanj
    Software: Microsoft Access 2007 SP2 Database File Version: Access 2000 I have an access program that I inherited from a previous employee. It uses forms for reports and since I don't have much experience in access I have continued to do this. I have created a copy of the program for another project and modified it to suit. I am having trouble getting more then one chart to print. All the charts display in form view, they all have the same properties (excepting data, position, etc.) For some reason they are not printing. They don't even show up in the print preview. I am thinking it must be something with the graphs themselves as they sometimes lose all information. I have to open the graphs in edit mode and change the data source from column to row and back again so that it gets redrawn. (Refresh doesn't fix it) So right now I don't even have a clue as to where to look so ideas are welcome. Edit #1 It seems to be a problem with linking to an unbound form. Subform Field Linker: Can't build a link between unbound forms. The query for the main form is SELECT tTest.ixTest, tMotorTypes.ixMotorType, tMotorTypes.asMotorType, tMotorTypes.fDeprecated, tTestType.asTest, tTest.asSerialNum, tTest.asOrderNum, tTest.asFrameNum, tTest.asRotorNum, tTest.asOperator, tTest.iStation, tTest.dtTestDate, tTest.ixTestType FROM tMotorTypes INNER JOIN (tTestType INNER JOIN tTest ON tTestType.ixTestType=tTest.ixTestType) ON tMotorTypes.ixMotorType=tTest.ixMotorType; The query for the chart is: SELECT qGraphRSTTemperatures.Frequency, qGraphRSTTemperatures.[Drive End], qGraphRSTTemperatures.[Non Drive End], qGraphRSTTemperatures.[Air In], qGraphRSTTemperatures.Core FROM qGraphRSTTemperatures ORDER BY qGraphRSTTemperatures.ixTemperature; Query qGraphRSTTemperatures: SELECT tElectricalData.dblFrequency AS Frequency, tTemperatures.dblDrvEnd AS [Drive End], tTemperatures.dblNonDrvEnd AS [Non Drive End], tTemperatures.dblAirIn AS [Air In], tTemperatures.dblCore AS Core, tSubTest.ixTest, tTemperatures.ixTemperature FROM (tSubTest INNER JOIN tElectricalData ON tSubTest.ixSubTest = tElectricalData.ixSubTest) LEFT JOIN tTemperatures ON tElectricalData.ixElectrical = tTemperatures.ixElectrical WHERE (((tSubTest.ixSubTestType)=5)) ORDER BY tSubTest.ixTest, tTemperatures.ixTemperature; So how come, in the form view it shows the graph with the correct data when linked thus: Child field: ixTest Master field: ixTest but won't print the graph. The graph will print if I remove the links, but then I have all the data from chart query as it is not limited by ixTest. edit #2 It seems to be a data retrieval/rendering issue in printing. Is there anything in printing that changes the context of records with respect to parent/child relationships?

    Read the article

  • Using MVC2 to update an Entity Framework v4 object with foreign keys fails

    - by jbjon
    With the following simple relational database structure: An Order has one or more OrderItems, and each OrderItem has one OrderItemStatus. Entity Framework v4 is used to communicate with the database and entities have been generated from this schema. The Entities connection happens to be called EnumTestEntities in the example. The trimmed down version of the Order Repository class looks like this: public class OrderRepository { private EnumTestEntities entities = new EnumTestEntities(); // Query Methods public Order Get(int id) { return entities.Orders.SingleOrDefault(d => d.OrderID == id); } // Persistence public void Save() { entities.SaveChanges(); } } An MVC2 app uses Entity Framework models to drive the views. I'm using the EditorFor feature of MVC2 to drive the Edit view. When it comes to POSTing back any changes to the model, the following code is called: [HttpPost] public ActionResult Edit(int id, FormCollection formValues) { // Get the current Order out of the database by ID Order order = orderRepository.Get(id); var orderItems = order.OrderItems; try { // Update the Order from the values posted from the View UpdateModel(order, ""); // Without the ValueProvider suffix it does not attempt to update the order items UpdateModel(order.OrderItems, "OrderItems.OrderItems"); // All the Save() does is call SaveChanges() on the database context orderRepository.Save(); return RedirectToAction("Details", new { id = order.OrderID }); } catch (Exception e) { return View(order); // Inserted while debugging } } The second call to UpdateModel has a ValueProvider suffix which matches the auto-generated HTML input name prefixes that MVC2 has generated for the foreign key collection of OrderItems within the View. The call to SaveChanges() on the database context after updating the OrderItems collection of an Order using UpdateModel generates the following exception: "The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted." When debugging through this code, I can still see that the EntityKeys are not null and seem to be the same value as they should be. This still happens when you are not changing any of the extracted Order details from the database. Also the entity connection to the database doesn't change between the act of Getting and the SaveChanges so it doesn't appear to be a Context issue either. Any ideas what might be causing this problem? I know EF4 has done work on foreign key properties but can anyone shed any light on how to use EF4 and MVC2 to make things easy to update; rather than having to populate each property manually. I had hoped the simplicity of EditorFor and DisplayFor would also extend to Controllers updating data. Thanks

    Read the article

  • C++ missing feature: variables with mutating names

    - by user345671
    Hello. Can someone please add a feature to C++? I would like to change variable names depending on the context. Example: Class stuff; if(stuff.hasSuperPowers()) { stuff becomes stuffWithSuperPowers; } That because creating a new variable and using an assignment sucks and lets stuff be acessible in that scope anyway. If you do it, please keep the becomes syntax unless it doesn't look good enough for you as a native English speaker. Thanks in advance.

    Read the article

  • Python raw strings and trailing back slashes.

    - by dash-tom-bang
    I ran across something once upon a time and wondered if it was a Python "bug" or at least a misfeature. I'm curious if anyone knows of any justifications for this behavior. I thought of it just now reading "Code Like a Pythonista," which has been enjoyable so far. I'm only familiar with the 2.x line of Python. Raw strings are strings that are prefixed with an r. This is great because I can use backslashes in regular expressions and I don't need to double everything everywhere. It's also handy for writing throwaway scripts on Windows, so I can use backslashes there also. (I know I can also use forward slashes, but throwaway scripts often contain content cut&pasted from elsewhere in Windows.) So great! Unless, of course, you really want your string to end with a backslash. There's no way to do that in a 'raw' string. In [9]: r'\n' Out[9]: '\\n' In [10]: r'abc\n' Out[10]: 'abc\\n' In [11]: r'abc\' ------------------------------------------------ File "<ipython console>", line 1 r'abc\' ^ SyntaxError: EOL while scanning string literal In [12]: r'abc\\' Out[12]: 'abc\\\\' So one slash before the closing quote is an error, but two slashes gives you two slashes! Certainly I'm not the only one that is bothered by this? Thoughts on why 'raw' strings are 'raw, except for slash-quote'? I mean, if I wanted to embed a single quote in there I'd just use double quotes around the string, and vice versa. If I wanted both, I'd just triple quote. If I really wanted three quotes in a row in a raw string, well, I guess I'd have to deal, but is this considered "proper behavior"?

    Read the article

  • WCF listenBacklog and maxConnections can't be set higher than 10. Why not?

    - by NeedWCFPro
    My service works great under low load. But under high load I start to get connection errors. I know about other settings but I am trying to change the listenBacklog parameter in particular for my TCP Buffered binding. If I set listenBacklog="10" I am able to telnet into the port where my WCF service is running. If I change listenBacklog to anything higher than 10 it will not let me telnet into my service when it is running. No errors seem to be thrown. What can I do? I get the same problem when I change my maxConnections away from 10. All other properties of the binding I can set higher without a problem. Here is what my binding looks like: <bindings> <netTcpBinding> <binding name="NetTcpBinding_IMyService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="1048576" maxConnections="10" maxReceivedMessageSize="1048576"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Transport"> <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"> </transport> <message clientCredentialType="Windows" /> </security> </binding> ... I really need to increase the values of maxConnections and listenBacklog

    Read the article

  • Dialog, LinearLayout, ScrollView size issues

    - by Sean
    I'm building a dialog class which inherits from Dialog, and all internal UI is programmatic. It's structured in the following way: Dialog +LinearLayout ++TextView ++ScrollView +++LinearLayout ++++ListView Unfortunately, when I show() the Dialog, it's too short. I'd like it to maximize and cover as much of the screen as possible, but only when there are enough items in the ListView to warrant it. I haven't found my answer in the docs, and I haven't been able to get it to work by setting WRAP_CONTENT as layout parameters, or setting heights manually. What is the proper way to approach this? Thanks, Sean

    Read the article

  • DataGridView not displaying a row after it is created

    - by joslinm
    Hi, I'm using Visual Studio 10 and I just created a Database using SQL Server CE. Within it, I made a table CSLDataTable and that automatically created a CSLDataSet & CSLDataTableTableAdapter. The three variables were automatically created in my MainWindow.cs class: cSLDataSet cSLDataTableTableAdapter cSLDataTableBindingSource I have added a DataGridView in my Form called dataGridView and datasource cSLDataTableBindingSource. In my MainWindow(), I tried adding a row as a test: public MainWindow() { InitializeComponent(); CSLDataSet.CSLDataTableRow row = cSLDataSet.CSLDataTable.NewCSLDataTableRow(); row.File_ = "file"; row.Artist = "artist11"; row.Album = "album"; row.Save_Structure = "save"; row.Sent = false; row.Error = true; row.Release_Format = "release"; row.Bit_Rate = "bitrate.."; row.Year = "year"; row.Physical_Format = "format"; row.Bit_Format = "bitformat"; row.File_Path = "File!!path"; row.Site_Origin = "what"; cSLDataSet.CSLDataTable.Rows.Add(row); cSLDataSet.AcceptChanges(); cSLDataTableTableAdapter.Fill(cSLDataSet.CSLDataTable); cSLDataTableTableAdapter.Update(cSLDataSet); dataGridView.Refresh(); dataGridView.Update(); } In regards to the DataSet methods I tried calling, I had been trying to find a "correct" way to interact with the adapter, dataset, and datatable to successfully show the row, but to no avail. I'm rather new to using SQL Server CE Database, and read a lot of the MSDN sites & thought I was on the right track, but I've had no luck. The DataGridView shows the headers correctly, but that new row does not show up.

    Read the article

  • are there any negative implications of sourcing a javascript file that does not actually exist?

    - by dreftymac
    If you do script src="/path/to/nonexistent/file.js" in an HTML file and call that in a browser, and there are no dependencies or resources anywhere else in the HTML file that expect the file or code therein to actually exist, is there anything inherently bad-practice about doing this? Yes, it is an odd question. The rationale is the developer is dealing with a CMS that allows custom (self-contained) javascript files to be provided in certain circumstances. The problem is the CMS is not very flexible when it comes to creating conditional includes for javascript. Therefore it is easier to just make references to the self-contained js files regardless of whether they are actually at the specified path. Since no errors are displayed to the user, should this practice be considered a viable option?

    Read the article

  • Hot to configure EnterpriseLibrary.Logging to only output message and timestamp

    - by thomas nn
    I am trying to log a simple string to a log file. I only need Category, message and timestamp. Thus I have configured app.config like this: <listeners> <add name="Flat File Destination" fileName="C:\Log\Phoenix.Common.Tests\Debug.log" header="-----------------------------------------------------------------" formatter="Text Formatter" footer="" rollFileExistsBehavior="Increment" rollInterval="Midnight" rollSizeKB="0" timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </listeners> <formatters> <add name="Text Formatter" template="Category: {category} Message: {message} Timestamp: {timestamp}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </formatters> But I get all kind of additional stuff in my log file: Priority: 50 EventId: 50 Severity: Verbose Title:Testing Log Machine: DK-PC-P4740 App Domain: TestAppDomain: 80803a4f-8e18-47bb-901e-cdac784c8041 ProcessId: 6492 Process Name: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\QTAgent32.exe How do I avoid this additional stuff? Can someone send me a link to an example that only log the message into the log file? /Thanks

    Read the article

  • How to hide items under the options from one select box upon selection of an item in another select

    - by jl
    Hi, I am new to jQuery and would like to know how is it possible for me to hide an option in a selection box based on the selection of another selection box. I have 5 selection boxes, this is for the administrator to select the users of a limited criteria. The <options> are create dynamically from the results of a database query and php, and they all have the same <options>. e.g. this is an example of the selection boxes with their option values. userbox1 - Amy, Bosh, Cathy, Daniel, Ethan userbox2 - Amy, Bosh, Cathy, Daniel, Ethan userbox3 - Amy, Bosh, Cathy, Daniel, Ethan userbox4 - Amy, Bosh, Cathy, Daniel, Ethan userbox5 - Amy, Bosh, Cathy, Daniel, Ethan So if the administrator selects Cathy in userbox1, Cathy will be automatically be hidden from the selection on the rest of the userbox. And if the administrator changes his/her mind and reselect another user call Ethan. The userboxes should be able to show the availability of Cathy in the selection. I am not sure is hide/show the correct status to be used in such cases. May I know how is it possible to write the function as stated above? If I am missing some current references, kindly point me to it. Thanks in advance.

    Read the article

  • ANN: ObjectDataSource and siaqodb -object database for .NET

    Siaqodb -object database for .NET, Mono and Silverlight version 1.1 (just released) fully support now ASP.NET 4.0 and by ObjectDataSource and ASP.NET Dynamic Data, building data-driven apps are faster then ever:http://siaqodb.com/?p=236...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • In Windows Vista, when starting any and every program, a "bad image" error is generated

    - by Mark Hatton
    I have a problem where any program is started under Windows Vista, the following error message is generated Bad Image C;\PROGRA~1\Google\GOOGLE~3\GOEC62~1.DLL is either not designed to run on Windows or it contains an error.Try installing the program again using the original installation media or contact your system administrator or the software vendor for support. This happens for every program started, including those that start automatically at boot time. My Google-fu is failing to solve this for me. I have already tried an "sfc /scannow" which did find some problems, but it said that it could not correct them. What might cause this problem? How might it be resolved?

    Read the article

  • Non-Windows, non-Unix-like OS's?

    - by dsimcha
    Since most operating systems I've heard of besides Windows seem to derive their heritage from Unix, I've been curious whether any OS's with the following characteristics exist: Not generally considered Unix-like, i.e. wasn't designed with Unix compatibility as a primary goal, doesn't use X11 as its default GUI in the most common distributions, doesn't support Unix commands by default, etc. Not in the Windows NT family. Is a modern production operating system, not a purely legacy operating system, a research/hobby project or an OS that's still in an alpha state. Is targeted at commodity x86/x64 PC hardware.

    Read the article

  • iPhone OS: KVO: Why is my Observer only getting notified at applicationDidfinishLaunching

    - by nickthedude
    I am basically trying to implement an achievement tracking setup in my app. I have a managedObjectModel class called StatTracker to keep track of all sorts of stats and I want my Achievement tracking class to be notified when those stats change so I can check them against a value and see if the user has earned an achievement. I've tried to impliment KVO and I think I'm pretty close to making it happen but the problem I'm running into is this: So in the appDelegate i have an Ivar for my Achievement tracker class, I attach it as an observer to a property value of my statTracker core data entity in the applicationDidFinishLaunching method. I know its making the connection because I've been able to trigger a UIAlert in my AchievementTracker instance, and I've put several log statements that should be triggered whenever the value on the StatTracker's property changes. the log statement appears only once at the application launch. I'm wondering if I'm missing something in the whole object lifecycle scheme of things, I just don't understand why the observer stops getting notified of changes after the applicationDidFinishLaunching method has run. Does it have something to do with the scope of the AchievementTracker reference or more likely the reference to my core data StatTracker is going away once that method finishes up. I guess I'm not sure the right place to place these if that is the case. Would love some help. Here is the code where I add the observer in my appDidFinishLaunching method: [[CoreDataSingleton sharedCoreDataSingleton] incrementStatTrackerStat:@"timesLaunched"]; achievementsObserver = [[AchievementTracker alloc] init]; StatTracker *object = nil; object = [[[CoreDataSingleton sharedCoreDataSingleton] getStatTracker] objectAtIndex:0]; NSLog(@"%@",[object description]); [[CoreDataSingleton sharedCoreDataSingleton] addObserver:achievementsObserver toStat:@"refreshCount"]; here is the code in my core data singleton: -(void) addObserver:(id)observer toStat:(NSString *) statToObserve { NSLog(@"observer added"); NSArray *array = [[NSArray alloc] init]; array = [self getStatTracker]; [[array objectAtIndex:0] addObserver:observer forKeyPath:statToObserve options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:NULL]; } and my AchievementTracker: - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { NSLog(@"achievemnt hit"); //NSLog("%@", [change description]); if ([keyPath isEqual:@"refreshCount"] && ((NSInteger)[change valueForKey:@"NSKeyValueObservingOptionOld"] == 60) ) { NSLog(@"achievemnt hit inside"); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"title" message:@"achievement unlocked" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:nil]; [alert show]; } }

    Read the article

  • Given the Following List (UL), how can it be serialized and sent to the Database

    - by nobosh
    I have the follow structure which is created with a nested sortable: <UL id="container"> <LI id="main1"> <input type="checkbox" /> Lorem ipsum dolor sit amet, consectetur <UL> <LI id="child2"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> </LI> <LI id="main3"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main4"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main5"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> Where I'm stuck is how to send this back to the database. I"m guessing that it needs to be serialized, does that sound right to? so that is looks something like: item[]=main1&item[]=221&item_221[]=21&item_221[]=2&item_221[]=211&item[]=22 I'm a little lost at this point and appreciate any tips to move me in the right direction. Thanks, B

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >