Search Results

Search found 1510 results on 61 pages for 'dan shields'.

Page 26/61 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Plotting Scientific data in .net

    - by Dan Schubel
    Does anyone have any recommendations for plotting scientific data in .net (c# winforms). Some of my requirements are: real time plotting, 3D (waterfall), multiple axis, ability to accept BindingList as a data source and recognize any changes to the data. I also need a high level of user interactivity such as the ability to graphically select 1 or more series, draw regions. highlight part of a series, etc. So far I've looked at Nevron, Synchfusion, Infragistics, TeeChart and a few others.

    Read the article

  • Setting corelocation results to NSNumber object parameters

    - by Dan Ray
    This is a weird one, y'all. - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { CLLocationCoordinate2D coordinate = newLocation.coordinate; self.mark.longitude = [NSNumber numberWithDouble:coordinate.longitude]; self.mark.latitude = [NSNumber numberWithDouble:coordinate.latitude]; NSLog(@"Got %f %f, set %f %f", coordinate.latitude, coordinate.longitude, self.mark.latitude, self.mark.longitude); [manager stopUpdatingLocation]; manager.delegate = nil; if (self.waitingForLocation) { [self completeUpload]; } } The latitude and longitude in that "mark" object are synthesized parameters referring to NSNumber iVars. In the simulator, my NSLog output for that line in the middle there reads: 2010-05-28 15:08:46.938 EverWondr[8375:207] Got 37.331689 -122.030731, set 0.000000 -44213283338325225829852024986561881455984640.000000 That's a WHOLE lot further East than 1 Infinite Loop! The numbers are different on the device, but similar--lat is still zero and long is a very unlikely high negative number. Elsewhere in the controller I'm accepting a button press and uploading a file (an image I just took with the camera) with its geocoding info associated, and I need that self.waitingForLocation to inform the CLLocationManager delegate that I already hit that button and once its done its deal, it should go ahead and fire off the upload. Thing is, up in the button-click-receiving method, I test see if CL is finished by testing self.mark.latitude, which seems to be getting set zero...

    Read the article

  • Create a T4MVC ActionLink with hash/pound sign)

    - by Dan Atkinson
    Is there a way to create a strongly typed T4MVC ActionLink with a hash in it? For example, here is the link I'd like to create: <a href="/Home/Index#food">Feed me</a> But there's no extension to the T4MVC object that can do this. <%= Html.ActionLink("Feed me", T4MVC.Home.Index()) %> So, what I end up having to do is create an action, and then embed it that way: <a href="<%= Url.Action(T4MVC.Home.Index()) %>"#food>Feed me</a> This isn't very desirable. Anyone have any ideas/suggestions? Thanks in advance

    Read the article

  • Invalid security validation exception inside a SharePoint workflow

    - by Dan Revell
    I'm having a strange security problem with a SharePoint workflow. Particular calls seem to result in the following exception: Microsoft.SharePoint.SPException: The security validation for this page is invalid. I've come across this error before and the simple fix is web.AllowUnsafeUpdates = true; ... web.AllowUnsafeUpdates = false; However I've never once encountered this problem inside a workflow before since a workflow runs as system. I first got this error in a code activity where I set the value of a column on the list item. Wrapping the item.Update in AllowUnsafeUpdates fixed it. After the code activity I have a CreateTask activity. This also causes the same error but only after running the code inside the activity's MethodInvoking. In both cases there's a SPListItem.UpdateItem involved within the stack trace. This call is failing a security check. I don't know anything about how this check works so I don't know where to look next. This is a strange one, because this SharePoint dev machine has been working fine for some time. No other projects or workflows exhibit this behaviour so that rules out an installation problem. There's just something about this particular workflow. [UPDATE] I've gotten around the issue by just creating a new project and building it up again. I still have the broken one and I'd still like to figure out the problem with it. I'd appreciate any suggestions of what it might be.

    Read the article

  • Tail-recursive pow() algorithm with memoization?

    - by Dan
    I'm looking for an algorithm to compute pow() that's tail-recursive and uses memoization to speed up repeated calculations. Performance isn't an issue; this is mostly an intellectual exercise - I spent a train ride coming up with all the different pow() implementations I could, but was unable to come up with one that I was happy with that had these two properties. My best shot was the following: def calc_tailrec_mem(base, exp, cache_line={}, acc=1, ctr=0): if exp == 0: return 1 elif exp == 1: return acc * base elif exp in cache_line: val = acc * cache_line[exp] cache_line[exp + ctr] = val return val else: cache_line[ctr] = acc return calc_tailrec_mem(base, exp-1, cache_line, acc * base, ctr + 1) It works, but it doesn't memorize the results of all calculations - only those with exponents 1..exp/2 and exp.

    Read the article

  • How to avoid an HttpException due to timeout

    - by Dan
    I'm working on a website powered by .NET asp/C# code. The clients require that sessions have a 25 minute timeout. However, sometimes the site is used, and a user stays connected for long periods of time (longer than 25 mins). Session_End is triggered: protected void Session_End(Object sender, EventArgs e) { Hashtable trackingInformaiton = (Hashtable)Application["trackingInformation"]; trackingInformaiton.Remove(Session["trackingID"]); } The user returns some time later, but when they interact with the website, they get an error, and we get this email notification: User: Unauthenticated User Error: System.Web.HttpException Description: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request... The telling part of the stack trace is System.Web.UI.Control.AddedControl. Apparently, the server has thrown away the session data, and is sending new data, but the client is trying to deal with old data. Hence the error that "the control tree into which viewstate is being loaded [doesn't] match the control tree that was used to save the viewstate during the prevoius request." So here's the question. How can I force instruct the user's browser to redirect to a "you're logged out" screen when the connection times out? (Is it something I should add to the Session_End method?)

    Read the article

  • What is the correct way to pass an object to WebApi RC controller

    - by Diver Dan
    I have a webapi project running rc I have a very basic controlller like [System.Web.Http.HttpPost] public void Update(Business business) { //if (business.Id == Guid.Empty) //{ // throw new HttpResponseException("Business ID not provided", HttpStatusCode.BadRequest); //} _repository.Update(business); //if (!isUpdated) //{ // throw new HttpResponseException("Business not found", HttpStatusCode.NotFound); //} } I found an example using HttpClient however it doesnt work with rc using (var client = new HttpClient()) { try { string url = string.Format("{0}{1}", ConfigurationManager.AppSettings["ApiBaseUrl"].ToString(),apiMethod); HttpRequestMessage request = new HttpRequestMessage(); MediaTypeFormatter[] formatter = new MediaTypeFormatter[] { new JsonMediaTypeFormatter() }; var content = request.CreateContent<Business>( business, MediaTypeHeaderValue.Parse("application/json"), formatter, new FormatterSelector()); HttpResponseMessage response = client.PostAsync(url, content).Result; return response.Content.ToString(); } catch (Exception ex) { return null; } } I get an error Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation(System.String, System.String)'. Passing the data from jquery is a piece of cake however I need call the api from code behind vs client side. Can someone point me in the right direction for calling the webapi? Thank you

    Read the article

  • Can a call to WaitHandle.SignalAndWait be ignored for performance profiling purposes?

    - by Dan Tao
    I just downloaded the trial version of ANTS Performance Profiler from Red Gate and am investigating some of my team's code. Immediately I notice that there's a particular section of code that ANTS is reporting as eating up to 99% CPU time. I am completely unfamiliar with ANTS or performance profiling in general (that is, aside from self-profiling using what I'm sure are extremely crude and frowned-upon methods such as double timeToComplete = (endTime - startTime).TotalSeconds), so I'm still fiddling around with the application and figuring out how it's used. But I did call the developer responsible for the code in question and his immediate reaction was "Yeah, that doesn't surprise me that it says that; but that code calls SignalAndWait [which I could see for myself, thanks to ANTS], which doesn't use any CPU, it just sits there waiting for something to do." He advised me to simply ignore that code and look for anything ELSE I could find. My question: is it true that SignalAndWait requires NO CPU overhead (and if so, how is this possible?), and is it reasonable that a performance profiler would view it as taking up 99% CPU time? I find this particularly curious because, if it's at 99%, that would suggest that our application is often idle, wouldn't it? And yet its performance has become rather sluggish lately. Like I said, I really am just a beginner when it comes to this tool, and I don't know anything about the WaitHandle class. So ANY information to help me to understand what's going on here would be appreciated.

    Read the article

  • Can you add a UITableViewController's TableView to another View?

    - by Dan Harrelson
    I've inserted a UITableViewController and it's corresponding UITableView into a simple IB document. The goal is to include the UITableView inside of a parent UIWindow (or UIView) with other "stuff" (anything really) adorning the table. Here's what that might look like in Interface Builder. http://danharrelson.com/images/skitch/iphone-tableview-3-20090701-205535.png I've tried this numerous times and always get to the same place. Build a working subclass of UITableViewController filled with data Customize the UTableView and it's cells including tap targets Add the newly created UITableViewController into an IB document Drag the UITableView out of the UITableViewController and into the main UIView Wire up the UITableViewController to the UITableView Note: adding the UITableViewController in code results in the same problem When running the app in the iPhone emulator or on a device the table displays correctly, but crashes the first time you try and interact with it. A scroll, a tap, anything crashes the app. This seems to be a delegate problem, like the UITableView doesn't know how to communicate back to the UITableViewController, but I have no idea how to correct the problem. So far I have been able to get by by customizing the tableHeaderView to get layouts that suffice, but I'd really prefer to have the other technique work.

    Read the article

  • How to move or position a legend in ggplot2

    - by Dan Goldstein
    I'm trying to create a ggplot2 plot with the legend beneath the plot. The ggplot2 book says on p 112 "The position and justification of legends are controlled by the theme setting legend.position, and the value can be right, left, top, bottom, none (no legend), or a numeric position". The following code works (since "right" it is the default), and it also works with "none" as the legend position, but "left", "top", "bottom", all fail with "Error in grid.Call.graphics("L_setviewport", pvp, TRUE) : Non-finite location and/or size for viewport" library(ggplot2) (myDat <- data.frame(cbind(VarX=10:1, VarY=runif(10)), Descrip=sample(LETTERS[1:3], 10, replace=TRUE))) qplot(VarX,VarY, data=myDat, shape=Descrip) + opts(legend.position="right") What am I doing wrong? Re-positioning a legend must be incredibly common, so I figure it's me.

    Read the article

  • Looking for evolutionary music example code

    - by Dan Dyer
    I would like to implement an interactive evolutionary algorithm for generating music (probably just simple melodies to start with). I'd like to use JFugue for this. Its website claims that it is well-suited to evolutionary music, but I can't find any evolutionary examples. I already have a framework to provide the evolutonary machinery. What I am looking for is some simple, working code that demonstrates viable approaches for the musical part (e.g. suitable encodings and evolutionary operators for the evolved tunes). I have some ideas how it might be achieved, but I'm not particularly knowledgeable about music theory, so to start with I'd like to just reimplement something that is known to work. So does anybody have, or know of, any freely available code (any language is fine) that demonstrates one or more approaches to evolutionary music? EDIT: I'm specifically looking for evolutionary code rather than other techniques that could be used for music synthesis.

    Read the article

  • Using statement question

    - by Dan
    I have two questions. 1) Should you always use a using statement on a connection? So, I would use it on the connection and then another one on a reader within the connection? So I would be using two using statements. 2) Lets say you use the using statement on the connection and also a reader being returned on the connection. So you have two using statements. Does it create two Try{}Finally{} blocks or just one? Thanks!

    Read the article

  • Powershell / .Net: Get a reference to an object returned by a method

    - by Dan Menes
    I am teaching myself PowerShell by writing a simple parser. I use the .Net framework class Collections.Stack. I want to modify the object at the top of the stack in place. I know I can pop() the object off, modify it, and then push() it back on, but that strikes me as inelegant. First, I tried this: $stk = new-object Collections.Stack $stk.push( (,'My first value') ) ( $stk.peek() ) += ,'| My second value' Which threw an error: Assignment failed because [System.Collections.Stack] doesn't contain a settable property 'peek()'. At C:\Development\StackOverflow\PowerShell-Stacks\test.ps1:3 char:12 + ( $stk.peek <<<< () ) += ,'| My second value' + CategoryInfo : InvalidOperation: (peek:String) [], RuntimeException + FullyQualifiedErrorId : ParameterizedPropertyAssignmentFailed Next I tried this: $ary = $stk.peek() $ary += ,'| My second value' write-host "Array is: $ary" write-host "Stack top is: $($stk.peek())" Which prevented the error but still didn't do the right thing: Array is: My first value | My second value Stack top is: My first value Clearly, what is getting assigned to $ary is a copy of the object at the top of the stack, so when I the object in $ary, the object at the top of the stack remains unchanged. Finally, I read up on teh [ref] type, and tried this: $ary_ref = [ref]$stk.peek() $ary_ref.value += ,'| My second value' write-host "Referenced array is: $($ary_ref.value)" write-host "Stack top is still: $($stk.peek())" But still no dice: Referenced array is: My first value | My second value Stack top is still: My first value I assume the peek() method returns a reference to the actual object, not the clone. If so, then the reference appears to be being replaced by a clone by PowerShell's expression processing logic. Can somebody tell me if there is a way to do what I want to do? Or do I have to revert to pop() / modify / push()?

    Read the article

  • Configuring Quercus to talk to JavaDB

    - by Dan Williams
    I am trying to get the Quercus PHP engine to connect with the JavaDB. I have successfully deployed Quercus in Glassfish, but I can't get Quercus to successfully connect with my database in JavaDB. Can anyone point me to an article or tutorial that treats this subject?

    Read the article

  • Getters and Setters are bad OO design?

    - by Dan
    Getters and Setters are bad Briefly reading over the above article I find that getters and setters are bad OO design and should be avoided as they go against Encapsulation and Data Hiding. As this is the case how can it be avoided when creating objects and how can one model objects to take this into account. In cases where a getter or setter is required what other alternatives can be used? Thanks.

    Read the article

  • Synchronized IEnumerator<T>

    - by Dan Bryant
    I'm putting together a custom SynchronizedCollection<T> class so that I can have a synchronized Observable collection for my WPF application. The synchronization is provided via a ReaderWriterLockSlim, which, for the most part, has been easy to apply. The case I'm having trouble with is how to provide thread-safe enumeration of the collection. I've created a custom IEnumerator<T> nested class that looks like this: private class SynchronizedEnumerator : IEnumerator<T> { private SynchronizedCollection<T> _collection; private int _currentIndex; internal SynchronizedEnumerator(SynchronizedCollection<T> collection) { _collection = collection; _collection._lock.EnterReadLock(); _currentIndex = -1; } #region IEnumerator<T> Members public T Current { get; private set;} #endregion #region IDisposable Members public void Dispose() { var collection = _collection; if (collection != null) collection._lock.ExitReadLock(); _collection = null; } #endregion #region IEnumerator Members object System.Collections.IEnumerator.Current { get { return Current; } } public bool MoveNext() { var collection = _collection; if (collection == null) throw new ObjectDisposedException("SynchronizedEnumerator"); _currentIndex++; if (_currentIndex >= collection.Count) { Current = default(T); return false; } Current = collection[_currentIndex]; return true; } public void Reset() { if (_collection == null) throw new ObjectDisposedException("SynchronizedEnumerator"); _currentIndex = -1; Current = default(T); } #endregion } My concern, however, is that if the Enumerator is not Disposed, the lock will never be released. In most use cases, this is not a problem, as foreach should properly call Dispose. It could be a problem, however, if a consumer retrieves an explicit Enumerator instance. Is my only option to document the class with a caveat implementer reminding the consumer to call Dispose if using the Enumerator explicitly or is there a way to safely release the lock during finalization? I'm thinking not, since the finalizer doesn't even run on the same thread, but I was curious if there other ways to improve this. EDIT After thinking about this a bit and reading the responses (particular thanks to Hans), I've decided this is definitely a bad idea. The biggest issue actually isn't forgetting to Dispose, but rather a leisurely consumer creating deadlock while enumerating. I now only read-lock long enough to get a copy and return the enumerator for the copy.

    Read the article

  • LINQ to SQL - Left Outer Join with multiple join conditions

    - by dan
    I have the following SQL which I am trying to translate to LINQ: SELECT f.value FROM period as p LEFT OUTER JOIN facts AS f ON p.id = f.periodid AND f.otherid = 17 WHERE p.companyid = 100 I have seen the typical implementation of the left outer join (ie. into x from y in x.DefaultIfEmpty() etc.) but am unsure how to introduce the other join condition ('AND f.otherid = 17') EDIT Why is the 'AND f.otherid = 17' condition part of the JOIN instead of in the WHERE clause? Because f may not exist for some rows and I still want these rows to be included. If the condition is applied in the WHERE clause, after the JOIN - then I don't get the behaviour I want. Unfortunately this: from p in context.Periods join f in context.Facts on p.id equals f.periodid into fg from fgi in fg.DefaultIfEmpty() where p.companyid == 100 && fgi.otherid == 17 select f.value seems to be equivalent to this: SELECT f.value FROM period as p LEFT OUTER JOIN facts AS f ON p.id = f.periodid WHERE p.companyid = 100 && AND f.otherid = 17 which is not quite what I'm after.

    Read the article

  • Zend Framework: Zend_translate and routing related issue

    - by Dan
    I have implemented Zend_Navigation, Zend_Translate in my application. The routing is setup in Bootstrap.php like below. $fc = Zend_Controller_Front::getInstance(); $zl=new Zend_Locale(); Zend_Registry::set('Zend_Locale',$zl); $lang=$zl->getLanguage().'_'.$zl->getRegion(); $router = $fc->getRouter(); $route = new Zend_Controller_Router_Route(':lang/:module/:controller/:action/*', array( 'lang'=>$lang, 'module'=>'default', 'controller'=>'index', 'action'=>'index' )); $router->addRoute('default', $route); $fc->setRouter($router); $fc->registerPlugin( new Plugin_LanguageSetup()); in LaunguageSetup Plugin i have defined the dispatchLoopStartup method to do the checking of the language param public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) { $this->createLangUrl($request); $this->_language = $request->getParam('lang'); if ((!isset($this->_language)) || !in_array($this->_language, $this->_languagesArray)) { $this->_language = 'en_US'; $request->setParam('lang', 'en_US'); } $file = APPLICATION_PATH.$this->_directory.$this->_language.'.csv'; $translate = new Zend_Translate('csv', $file, $this->_language); Zend_Registry::set('Zend_Translate', $translate); $zl = Zend_Registry::get('Zend_Locale'); $zl->setLocale($this->_language); Zend_Registry::set('Zend_Locale', $zl); // $fc = Zend_Controller_Front::getInstance(); // $router = $fc->getRouter(); // $route = new Zend_Controller_Router_Route(':lang/:module/:controller/:action/*', array( // 'lang'=>$this->_language, 'module'=>'default', 'controller'=>'index', 'action'=>'index' // )); // $router->addRoute('default', $route); // $fc->setRouter($router); } What happen is the language always have the default value, the 'lang' param never default lang value in route, even if i type it in the address bar manually i.e /en_US/module/controller/action/ It always get revert back to the default Zend_locale(); Only way i can fix it is to setup the route again in the plugin and inject a correct language value as default. Any Idea why?

    Read the article

  • Making Firefox render canvas text the same as CSS text

    - by Dan Forys
    I've been experimenting with the canvas tag and Javascript. I've made a page that takes Tweets from the Twitter public timeline and animates them into view. It works by using a canvas element in the background for the animation. When the animation is complete, it creates a div element with the same text over the top. I do this so that the tweet text is selectable and links are clickable. Now, in Safari, Chrome and even Opera, the canvas text and div text look almost exactly the same. Yet in Firefox, the size of the text is different enough to make it 'jump' at the point it changes into the div. Does anyone know how to make Firefox render the text the same on the canvas element and the div using CSS? Or is this a rendering inconsistency with the engine. I have put the page on my website if you want to see what I mean. Now for the code: The CSS I'm using for rendering the div contains: line-height: 21px; font-weight: 100; font-family: Georgia, "New Century Schoolbook", "Nimbus Roman No9 L", serif; font-size: 20px; For rendering on the canvas I'm using: this.context.font = this.scale + 'px Georgia'; this.context.fillStyle = "white"; this.context.strokeStyle = 'white'; this.context.fillText(this.text, 0, 0); this.context.strokeText(this.text, 0, 0); where this.scale is an animated scale factor that finishes at 20px exactly. So, to recap, I'm using the same font and ending up at the same px size, yet Firefox renders the text differently between Canvas and CSS. (edit) Here's a screenshot example: First line is the text animating in using canvas, second line is the resulting div.

    Read the article

  • Legacy Java code use of com.sun.net.ssl.internal.ssl.Provider()

    - by Dan
    I am working with some code from back in 2003. There is a reference to the following class: new com.sun.net.ssl.internal.ssl.Provider() It is causing an error: Access restriction: The type Provider is not accessible due to restriction on required library /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/jre/lib/jsse.jar Does anyone have any suggestions for a suitable alternative to using this class?

    Read the article

  • Left Outer Join - SQL2005

    - by Dan beadle
    I thought I knew enough SQL, but I am having problem with a left outer join. I have an expense detail record that needs to link to a table by dept and account_code. The query looks something like this: select Detail.Spend, Budget.BudgetAmt from detail left outer join budget on detail.dept = budget.dept AND dept.account_code = budget.account_code This works great as long as there is a record that exactly matches the join conditions. But sometimes, there is no matching budget item. I want to get back the Detail.Spend from the details table with nulls for the budgetAmt. Instead, I don't get this record at all. Isn't Left Outer Join supposed to return the left (detail) table when there is no match? Is there something different when multiple criteria are used as I do here? Thanks

    Read the article

  • What is CDbl doing?

    - by Dan Tao
    I had until recently been under the impression that the CDbl(x) operation in VB.NET was essentially a cast (i.e., the VB equivalent of (double)x in C#); but a recent discovery has revealed that this is not the case. If I have this string: Dim s As String = "12345.12345-" And I do this: Dim d As Double = CDbl(s) d will be set to the value -12345.12345! Now, don't get me wrong, this is kind of convenient in my particular scenario; but I have to admit I'm confused as to why this works. In particular, I'm confused because: Double.Parse does not work with the above input. Double.TryParse does not work. Convert.ToDouble does not work. How is CDbl so clever?

    Read the article

  • ModelMetadata: ShowForEdit property not appearing to work.

    - by Dan
    Iv wrote an MetaDataProvider like the one below and am using it in conjunction with Editor templates. The DisplayName is working correctly, but for some reason the ShowForEdit value it not having any effect. Any ideas? public class MyModelMetadataProvider : DataAnnotationsModelMetadataProvider { protected override ModelMetadata CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName) { var metadata = base.CreateMetadata(attributes, containerType, modelAccessor, modelType, propertyName); I metadata.DisplayName = "test"; metadata.ShowForEdit = false; metadata.ShowForDisplay = false; metadata.HideSurroundingHtml = true; return metadata; } }

    Read the article

  • theming sencha touch error: File to import not found or unreadable: sencha-tou ch/default/all

    - by dan
    I just cant find a workarround for this, please help my config.rb in location $PROJECT_HOME/assets/www/theming dir = File.dirname('..Path_to_project_home..\assets\www\theming\config.rb') load File.join(dir, '..', 'lib', 'touch', 'resources', 'themes') sass_path = dir css_path = dir environment = :production output_style = :compressed this is my app.scss: @import 'sencha-touch/default/all'; @include sencha-panel; @include sencha-buttons; @include sencha-toolbar; @include sencha-list; @include sencha-layout; @include sencha-sheet; @include sencha-msgbox; in the console in the directory of the 'sass_path' I run compass compile app.scss but I get the following error: File to import not found or unreadable: sencha-touch/default/all. Please help, cant solve this.

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >