Daily Archives

Articles indexed Tuesday May 18 2010

Page 16/121 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Finally! Entity Framework working in fully disconnected N-tier web app

    - by oazabir
    Entity Framework was supposed to solve the problem of Linq to SQL, which requires endless hacks to make it work in n-tier world. Not only did Entity Framework solve none of the L2S problems, but also it made it even more difficult to use and hack it for n-tier scenarios. It’s somehow half way between a fully disconnected ORM and a fully connected ORM like Linq to SQL. Some useful features of Linq to SQL are gone – like automatic deferred loading. If you try to do simple select with join, insert, update, delete in a disconnected architecture, you will realize not only you need to make fundamental changes from the top layer to the very bottom layer, but also endless hacks in basic CRUD operations. I will show you in this article how I have  added custom CRUD functions on top of EF’s ObjectContext to make it finally work well in a fully disconnected N-tier web application (my open source Web 2.0 AJAX portal – Dropthings) and how I have produced a 100% unit testable fully n-tier compliant data access layerfollowing the repository pattern. http://www.codeproject.com/KB/linq/ef.aspx In .NET 4.0, most of the problems are solved, but not all. So, you should read this article even if you are coding in .NET 4.0. Moreover, there’s enough insight here to help you troubleshoot EF related problems. You might think “Why bother using EF when Linq to SQL is doing good enough for me.” Linq to SQL is not going to get any innovation from Microsoft anymore. Entity Framework is the future of persistence layer in .NET framework. All the innovations are happening in EF world only, which is frustrating. There’s a big jump on EF 4.0. So, you should plan to migrate your L2S projects to EF soon.

    Read the article

  • fiddler to calculate page load time of a silverlight application

    - by Pritam Karmakar
    Hi All, I have a silverlight application, that I want to calculate page load time through C# using Fiddler API. Could you please share some useful guidelines how I can do it using fiddler/fiddlercore. Here are some details what I want to do... Launch fiddler and launch IE (without using httpweb request) Load my application url. Calculate page load time Earlier I tried to use httpwatch API to calculate it. Httpwatch do all these stuffs, but it doesn't calculate the silverlight component load time. Please help. Thanks, Pritam

    Read the article

  • How to deploy ClickOnce .Net 3.5 application on 3.0 machine

    - by Buthrakaur
    I have .Net 3.5 SP1 WPF application which I'm successfully deploying to client computers using ClickOnce. Now I got new requirement - one of our clients need to run the application on machines equipped just with .Net 3.0 and it's entirely impossible to upgrade or install anything on the machines. I already tried to run the 3.5 application with some of the 3.5FW DLLs copied to the application directory and it worked without any problems. The only problem at the moment is ClickOnce. I already made it to include the 3.5FW System.*.dll files in list of application files, but it always aborts installation on 3.0 machine with this error message: Unable to install or run the application. The application requires that assembly System.Core Version 3.5.0.0 be installed in the Global Assembly Cache (GAC) first. Please contact your system administrator. I already tried to tweak prerequisites on Publish tab of my project, but no combination solved the issue. What part of ClickOnce is responsible for checking prerequisites? I already tried to deploy using mageui.exe, but the 3.5FW error is still present. What should I do to fore ClickOnce to stop checking any prerequisites at all? The project is created using VS2010.

    Read the article

  • Is it possible to find out what FlashBuilder is doing during compilation?

    - by justkevin
    I've found that Flash Builder 4 (formerly Flex Builder) has trouble working with large projects. After a certain point, builds seem to take longer and longer. I've tried many different ways of improving build time including: Moving embedded resources into externally linked projects. Using -incremental. Tweaking the .ini jvm settings including memory and -server. Turning off automatic build (I'd prefer not to have to do this, because one of the main reasons for using an IDE is to be told about errors as you make them). Deleting the project and re-checking out from the repository. While some of these may help a bit, the performance is still annoyingly slow. I feel if I knew what was taking so long I could refactor my projects to build faster. Is there some setting that tells FlashBuilder to let me see what parts of the build process take so much time?

    Read the article

  • VB.NET 2008, Windows 7 and saving files

    - by James Brauman
    Hello, We have to learn VB.NET for the semester, my experience lies mainly with C# - not that this should make a difference to this particular problem. I've used just about the most simple way to save a file using the .NET framework, but Windows 7 won't let me save the file anywhere (or anywhere that I have found yet). Here is the code I am using to save a text file. Dim dialog As FolderBrowserDialog = New FolderBrowserDialog() Dim saveLocation As String = dialog.SelectedPath ... Build up output string ... Try ' Try to write the file. My.Computer.FileSystem.WriteAllText(saveLocation, output, False) Catch PermissionEx As UnauthorizedAccessException ' We do not have permissions to save in this folder. MessageBox.Show("Do not have permissions to save file to the folder specified. Please try saving somewhere different.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Catch Ex As Exception ' Catch any exceptions that occured when trying to write the file. MessageBox.Show("Writing the file was not successful.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try The problem is that this using this code throws an UnauthorizedAccessException no matter where I try to save the file. I've tried running the .exe file as administrator, and the IDE as administrator. Is this just Windows 7 being overprotective? And if so, what can I do to solve this problem? The requirements state that I be able to save a file! Thanks.

    Read the article

  • How to generate a cryptographically secure Double between 0 and 1?

    - by Portman
    I know how to generate a random number between 0 and 1 using the NextDouble method of the pseudo-random number generator. var rng1 = new System.Random(); var random1 = rng1.NextDouble(); // generates a random double between 0 and 1.0 And I know how to fill a random byte array using the cryptographically secure random number generator. Byte[] bytes = new Byte[8]; var rng2 = new System.Security.Cryptography.RNGCryptoServiceProvider(); rng2.GetBytes(bytes); // generates 8 random bytes But how can I convert the byte-array output of RNGCryptoServiceProvider into a random number between 0 (inclusive) and 1 (exclusive)?

    Read the article

  • Why is this consider bad practice? or is it? (ASP.Net)

    - by user318573
    Would this code be considered bad practice: <div id="sidebar"> <% =DisplayMeetings(12) %> </div> This is a snippet of code from the default.aspx of a small web app I have worked on. It works perfectly well, runs very fast, but as always, I am aware of the fact that just because it works, doesn't mean it is OK. Basically, the DisplayMeetings subroutine outputs a bunch of formatted HTML (an unordered list actually), with no formatting, just the requisite html, and then my CSS performs all the necessary formatting. The data for generating the list comes from an SQL server database (the parameter controls how many rows to return) and I am using stored procedures and datareader for fast access. This keeps my front-end extraordinary simple and clean, imho, and lets me do all the work in VB or C# in a separate module. I could of course use a databound repeater (and probably 6 or more other methods) of accomplishing the same thing, but are they any better? Other than loosing the design-time features of VS2010?

    Read the article

  • PHP not outputting errors?

    - by Rob
    My webpage is putting out a 500 Internal Server Error. I've turned on E_ALL for error reporting in the php.ini, and restarted the httpd. I've even used error_reporting(E_ALL) and error_reporting(-1) but still no luck. Any suggestions? OS: CentOS5.5 PHP: 5.2.6 HTTPD: Apache/2.2.3

    Read the article

  • VMware ESXi VMI Paravirtualization vs 64-bit OS

    - by netvope
    VMware ESXi 4 supports VMI paravirtualization for 32-bit OS but not for 64-bit OS. For performance consideration, is it better to use a 32-bit Ubuntu Server guest without paravirtualization or a 64-bit one with VMI paravirtualization? Hardware: Core 2 Quad, 8 GB RAM Workload: Software development/testing, webserver, database

    Read the article

  • Cisco IOS rewrite http url

    - by ensnare
    Is there a way that I can configure my router to rewrite http requests? So for example, if: http://www.example.com/porn.gif is being accessed, it'll be re-written as: http://172.16.0.1/denied.gif But transparently returned to the client? Thank you.

    Read the article

  • Logical volume that spans raid1 sets: what happens if a RAID fails?

    - by Jeff Shattock
    Consider the following scenario: /dev/md0 - 10GB RAID 1 volume built from /dev/sda and /dev/sdb /dev/md1 - 10GB RAID 1 volume built from /dev/sdc and /dev/sdd /dev/vg0 - volume group containing md0 and md1 /dev/vg0/lv0 - 15GB logical volume The raid devices are created with mdadm; the logical volumes by LVM. What happens to lv0 if md0 fails entirely? That is, if both sda and sdb disintegrate so that the md0 device can not start. Is the portion of the data that resided on md1 still accessible, or is the entire LV gone? Would the answer change if lv0 were created as a striped volume vs non-striped?

    Read the article

  • which scope should a DAO typically have.

    - by Andreas Petersson
    its out of question that a dao will not hold any state. however, for easiest access to the class, is it better to use prototype( = new every time) or singleton? simple object creation is cheap for dao's.. it typically only holds a sessionfactory, accessing the object from a list of singletons may be equally expensive. clarfication: the focus of this question is, if there is a common convention to the scoping of daos.

    Read the article

  • Cannot convert from string exception

    - by swetha
    I got an exception sayin, CollectionConverter cannot convert from System.String. sample piece of code : TypeConverter type1 = TypeDescriptor.GetConverter(somemethodtype); Obj = typeConvert.ConvertFromString(result["xxx"].ToString()); can someone tell me y i get dis exception and how to resolve?

    Read the article

  • Bruteforcing Blackberry PersistentStore?

    - by Haoest
    Hello, I am experimenting with Blackberry's Persistent Store, but I have gotten nowhere so far, which is good, I guess. So I have written a a short program that attempts iterator through 0 to a specific upper bound to search for persisted objects. Blackberry seems to intentionally slow the loop. Check this out: String result = "result: \n"; int ub = 3000; Date start = Calendar.getInstance().getTime(); for(int i=0; i<ub; i++){ PersistentObject o = PersistentStore.getPersistentObject(i); if (o.getContents() != null){ result += (String) o.getContents() + "\n"; } } result += "end result\n"; result += "from 0 to " + ub + " took " + (Calendar.getInstance().getTime().getTime() - start.getTime()) / 1000 + " seconds"; From 0 to 3000 took 20 seconds. Is this enough to conclude that brute-forcing is not a practical method to breach the Blackberry? In general, how secure is BB Persistent Store?

    Read the article

  • Launching an activity at its current state.

    - by Profete162
    Hello, I am trying to make a task switcher and i succed in it. My only problem is that when I launch activities, they are relaunched as they were new activities ( for instance, I am writing an email, i press home and go into my activity,launch email, and then the app launch the email bout goes back at the inbox and the email is lost) So that's not true multitasking. Here are my steps: 1) getting all the running apps: List<ActivityManager.RunningTaskInfo> allTasks = activityManager.getRunningTasks(30); 2) getting the intent: for (ActivityManager.RunningTaskInfo aTask : allTasks) { Intent i = new Intent(Intent.ACTION_MAIN); i.setComponent(aTask.baseActivity); (...) 3) Launching the application when clicking on the button: intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED).addCategory(Intent.CATEGORY_LAUNCHER); monthis.startActivity(intent); ` What is wrong with this code? Should I do something different to get it? Thank a lot for any answer.

    Read the article

  • Finding the most frequent subtrees in a collection of (parse) trees

    - by peter.murray.rust
    I have a collection of trees whose nodes are labelled (but not uniquely). Specifically the trees are from a collection of parsed sentences (see http://en.wikipedia.org/wiki/Treebank). I wish to extract the most common subtrees from the collection - performance is not (yet) an issue. I'd be grateful for algorithms (ideally Java) or pointers to tools which do this for treebanks. Note that order of child nodes is important. EDIT @mjv. We are working in a limited domain (chemistry) which has a stylised language so the varirty of the trees is not huge - probably similar to children's readers. Simple tree for "the cat sat on the mat". <sentence> <nounPhrase> <article/> <noun/> </nounPhrase> <verbPhrase> <verb/> <prepositionPhrase> <preposition/> <nounPhrase> <article/> <noun/> </nounPhrase> </prepositionPhrase> </verbPhrase> </sentence> Here the sentence contains two identical part-of-speech subtrees (the actual tokens "cat". "mat" are not important in matching). So the algorithm would need to detect this. Note that not all nounPhrases are identical - "the big black cat" could be: <nounPhrase> <article/> <adjective/> <adjective/> <noun/> </nounPhrase> The length of sentences will be longer - between 15 to 30 nodes. I would expect to get useful results from 1000 trees. If this does not take more than a day or so that's acceptable. Obviously the shorter the tree the more frequent, so nounPhrase will be very common. EDIT If this is to be solved by flattening the tree then I think it would be related to Longest Common Substring, not Longest Common Sequence. But note that I don't necessarily just want the longest - I want a list of all those long enough to be "interesting" (criterion yet to be decided).

    Read the article

  • Accessing browser events

    - by netprotector
    Hi, I am writing a chrome plugin in which I would like to receive events such as "load", "unload" of window and page. However, I'm not getting any concrete clue to start with. Can anyone tell me how to capture DOM event in plugin? Does Chrome support this feature? Thank you.

    Read the article

  • c# How to make linq master detail query for 0..n relationship?

    - by JK
    Given a classic DB structure of Orders has zero or more OrderLines and OrderLine has exactly one Product, how do I write a linq query to express this? The output would be OrderNumber - OrderLine - Product Name Order-1 null null // (this order has no lines) Order-2 1 Red widget I tried this query but is not getting the orders with no lines var model = (from po in Orders from line in po.OrderLines select new { OrderNumber = po.Id, OrderLine = line.LineNumber, ProductName = line.Product.ProductDescription, } ) I think that the 2nd from is limiting the query to only those that have OrderLines, but I dont know another way to express it. LINQ is very non-obvious if you ask me!

    Read the article

  • iphone/ipad adding adding and removing a subview doesnt work

    - by Mark
    Im have a slight amount of trouble adding a new view to my scene, I have the code like this: - (void) showMyDayView { NSLog(@"My Day View was touched"); MyDayViewController *temp = [[MyDayViewController alloc] initWithNibName: @"MyDayView" bundle:nil]; self.myDayViewController = temp; NSLog(@"superview: %@", [[self mainNavView] superview]); [[self mainNavView] removeFromSuperview]; NSLog(@"after removal main: %@", [self mainNavView]); NSLog(@"after removal view: %@", [self view]); NSLog(@"after removal superview: %@", [[self view] superview]); [[[self view] superview] addSubview: [self.myDayViewController view]]; [temp release]; } And when I run this code, the console says "after removal superview: (null)" so when I add the subView to the superview, nothing happens because the superview is null. Any ideas? Thanks Mark

    Read the article

  • Jquery Tools Tabs: How to capture onClick event when selection is on current tab?

    - by littlenewton
    Hi All, I tried to ask this question on the jquery tools forum, but didn't get a response, hopefully someone here can help. Question: It seems the onClick event does not get fired when user is already on current tab, I think that make sense for most cases. However, in my case, I do want to capture the onClick event even when the curent tab is already the selection. Is there a way to do this? Thanks!

    Read the article

  • Receiving Text From Another Application

    - by Garry
    Hi, I'm building some home automation software with Cocoa/Objective-C. The main application will have a minimal GUI and will most likely be represented by a status bar icon only. I'm using proprietary speech-to-text software (MacSpeech Dictate) that takes my voice command and converts it to plain text. I then need to send this plain text to my app for parsing. Is there a way to send a string to a Cocoa application? Could AppleScript achieve this? How would I make the NSString string in my app "available" to receive the passed string? For reasons that are beyond the scope of this question - it is not possible to dictate the command directly into my app. Many thanks in advance,

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >