Search Results

Search found 1642 results on 66 pages for 'dan morgan'.

Page 45/66 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • release vs setting-to-nil to free memory

    - by Dan Ray
    In my root view controller, in my didReceiveMemoryWarning method, I go through a couple data structures (which I keep in a global singleton called DataManager), and ditch the heaviest things I've got--one or maybe two images associated with possibly twenty or thirty or more data records. Right now I'm going through and setting those to nil. I'm also setting myself a boolean flag so that various view controllers that need this data can easily know to reload. Thusly: DataManager *data = [DataManager sharedDataManager]; for (Event *event in data.eventList) { event.image = nil; event.thumbnail = nil; } for (WondrMark *mark in data.wondrMarks) { mark.image = nil; } [DataManager sharedDataManager].cleanedMemory = YES; Today I'm thinking, though... and I'm not actually sure all that allocated memory is really being freed when I do that. Should I instead release those images and maybe hit them with a new alloc and init when I need them again later?

    Read the article

  • C++ unicode UTF-16 encoding

    - by Dan
    Hi all, I have a wide char string is L"hao123--??????", and it must be encoded to "hao123--\u6211\u7684\u4E0A\u7F51\u4E3B\u9875". I was told that the encoded string is a special “%uNNNN” format for encoding Unicode UTF-16 code points. In this website(http://rishida.net/tools/conversion/), it tell me it's JavaScript escapes. But I don't know how to encode it with C++. It that any library to do this work? or give me some tips. Thanks my friends!

    Read the article

  • EntityFramework & RowNumber

    - by Dan
    Hello. How can I query RowNumber with Entity Framework? For example: var result = data.Users .OrderByDescending("Birthday") .ThenBy("LastName") .ThenBy("FirstName") .Select(u => { RowNumber = ???, u.FirstName, u.LastName }); I want to implement paging for my grid, but I cannot solve problem with finding page with needed user. I'm using EF4.0. Select method with index(http://msdn.microsoft.com/en-us/vcsharp/aa336758.aspx#SelectIndexed) not works with EF. May be there is another way to implement this?

    Read the article

  • Xcode "Build and Archive" from command line

    - by Dan Fabulich
    Xcode 3.2 provides an awesome new feature under the Build menu, "Build and Archive" which generates an .ipa file suitable for Ad Hoc distribution. You can also open the Organizer, go to "Archived Applications," and "Submit Application to iTunesConnect." Is there a way to use "Build and Archive" from the command line (as part of a build script)? I'd assume that xcodebuild would be involved somehow, but the man page doesn't seem to say anything about this. UPDATE Michael Grinich requested clarification; here's what exactly you can't do with command-line builds, features you can ONLY do with Xcode's Organizer after you "Build and Archive." You can click "Share Application..." to share your IPA with beta testers. As Guillaume points out below, due to some Xcode magic, this IPA file does not require a separately distributed .mobileprovision file that beta testers need to install; that's magical. No command-line script can do it. For example, Arrix's script (submitted May 1) does not meet that requirement. More importantly, after you've beta tested a build, you can click "Submit Application to iTunes Connect" to submit that EXACT same build to Apple, the very binary you tested, without rebuilding it. That's impossible from the command line, because signing the app is part of the build process; you can sign bits for Ad Hoc beta testing OR you can sign them for submission to the App Store, but not both. No IPA built on the command-line can be beta tested on phones and then submitted directly to Apple. I'd love for someone to come along and prove me wrong: both of these features work great in the Xcode GUI and cannot be replicated from the command line.

    Read the article

  • Magento - blank lines being added to wsdl file

    - by dan.codes
    I am trying to call the API but I keep getting a soap error that can't load the file. I found that the reason is there are about 3 blank lines at the top of the XML file that is returned. I found this by doing wget url. This use to work just fine, when I debug through the API controller the response or xml looks fine all the way through, I don't see any spaces at all. I have no idea what might be causing this. I don't think there is anything we modified that would do this.

    Read the article

  • Setting String as Image Source in C#

    - by Dan
    UPDATE: Okay I've changed my code to this: if (appSettings.Contains("image")) { Uri uri = new Uri( (string)appSettings["image"] + ".jpg", UriKind.Absolute); ImageSource imgSource = new BitmapImage(uri); myImage.Source = imgSource; } else { Uri uriDefault = new Uri("default.jpg", UriKind.Absolute); ImageSource imgSourceDefault = new BitmapImage(uriDefault); myImage.Source = imgSourceDefault; } But now I get "Invalid URI: The format of the URI could not be determined". Well I've looked up several methods to fix this in my Windows Phone 7 app but I can't seem to find anything that works. What confuses me is that I've done something just like this before with no problem, so I'm not sure why it's not working. The code causing me the problem is this: if (appSettings.Contains("image")) { myImage.Source = (string)appSettings["image"]; } else { myImage.Source = "default.jpg"; } The error I get is this "Cannot implicitly convert type 'string' to 'System.Windows.Media.ImageSource". The reason this confuses me is because I did this Twitter app tutorial: http://weblogs.asp.net/scottgu/archive/2010/03/18/building-a-windows-phone-7-twitter-application-using-silverlight.aspx , in which you bind the image source directly to a string. So what can I do to remedy this?

    Read the article

  • why is win7/ie8 favorites the start menu? [closed]

    - by Dan
    does anyone know why Win7 Pro IE8 favorites are really the programs in the start menu? I don't see the point, there are usually tons of folders here so it is hard to find internet shortcuts, and why would I want to open a program from IE? I don't like to IE but Firefox usually freezes up on Win7 after 15 minutes...so I am using IE8 more and more. any ideas? thanks

    Read the article

  • Progress bar while applet loads

    - by Dan
    OK so, let's say I have a Java applet that takes a while to load (~5 secs). It's getting the mysql-connector.jar and it's loading. Well.. instead of the gray box with the coffee logo... can I make it have a simple progress bar with the percent? Thanks.

    Read the article

  • Unit testing MVC.net Redirection

    - by Dan
    How do I Unit Test a MVC redirection? public ActionResult Create(Product product) { _productTask.Save(product); return RedirectToAction("Success"); } public ActionResult Success() { return View(); } Is Ayende's approach still the best way to go, with preview 5: public static void RenderView(this Controller self, string action) { typeof(Controller).GetMethod("RenderView").Invoke(self,new object[] { action} ); } Seems odd to have to do this, especially as the MVC team have said they are writing the framework to be testable.

    Read the article

  • Multiple Class in JDO Query

    - by Dan Delgado
    Hello, I'm currently developing in GAE and I have to query like this using JDO: SELECT table1.column1, table2.column2 FROM table1, table2 WHERE table1.column1 = table2.column1; I tried this one but it won't work: String query = "select from "+Assessment.class.getName()+ "a, "+ Project.class.getName()+" p where a.projectId == p.id && p.owner=='"+owner+"'"; Is this valid or this really isn't supported yet? If this is valid, why is it not working then? If it isn't, what should I do to make this work? Thank you!

    Read the article

  • How would you implement this "WorkerChain" functionality in .NET?

    - by Dan Tao
    Sorry for the vague question title -- not sure how to encapsulate what I'm asking below succinctly. (If someone with editing privileges can think of a more descriptive title, feel free to change it.) The behavior I need is this. I am envisioning a worker class that accepts a single delegate task in its constructor (for simplicity, I would make it immutable -- no more tasks can be added after instantiation). I'll call this task T. The class should have a simple method, something like GetToWork, that will exhibit this behavior: If the worker is not currently running T, then it will start doing so right now. If the worker is currently running T, then once it is finished, it will start T again immediately. GetToWork can be called any number of times while the worker is running T; the simple rule is that, during any execution of T, if GetToWork was called at least once, T will run again upon completion (and then if GetToWork is called while T is running that time, it will repeat itself again, etc.). Now, this is pretty straightforward with a boolean switch. But this class needs to be thread-safe, by which I mean, steps 1 and 2 above need to comprise atomic operations (at least I think they do). There is an added layer of complexity. I have need of a "worker chain" class that will consist of many of these workers linked together. As soon as the first worker completes, it essentially calls GetToWork on the worker after it; meanwhile, if its own GetToWork has been called, it restarts itself as well. Logically calling GetToWork on the chain is essentially the same as calling GetToWork on the first worker in the chain (I would fully intend that the chain's workers not be publicly accessible). One way to imagine how this hypothetical "worker chain" would behave is by comparing it to a team in a relay race. Suppose there are four runners, W1 through W4, and let the chain be called C. If I call C.StartWork(), what should happen is this: If W1 is at his starting point (i.e., doing nothing), he will start running towards W2. If W1 is already running towards W2 (i.e., executing his task), then once he reaches W2, he will signal to W2 to get started, immediately return to his starting point and, since StartWork has been called, start running towards W2 again. When W1 reaches W2's starting point, he'll immediately return to his own starting point. If W2 is just sitting around, he'll start running immediately towards W3. If W2 is already off running towards W3, then W2 will simply go again once he's reached W3 and returned to his starting point. The above is probably a little convoluted and written out poorly. But hopefully you get the basic idea. Obviously, these workers will be running on their own threads. Also, I guess it's possible this functionality already exists somewhere? If that's the case, definitely let me know!

    Read the article

  • Typical text encoding and EOL behavior on mobile devices

    - by Dan W
    Typical things to worry about when dealing with text are the BOM/signature, encoding, and the end of line (EOL) char/chars. I know that Windows often favours \r\n (CR+LF) and Mac/Linux favours \n (LF), but how about popular mobile devices such as the iPhone and Android? Do typical apps on those platforms favour one or the other (or maybe even \r for iOS)? I'll supply both types to the user just in case, but I'd like to choose one as default. Also, which text encodings are mobiles most likely to use - UTF-8, iso-8859-1, Windows 1252 (or other default codepage) or maybe even UTF-16? And if they use UTF-8/16, are they likely to need (or require not having) a BOM/signature? What is the typical behavior here? Once again, I'll supply a range of encodings to the user just in case, but I'd like to prioritize or use certain encodings as default if it's appropriate.

    Read the article

  • Separation of static and dynamic content in Java EE applications

    - by Dan
    We work with IBM products and we typically use IBM Http Servers (read Apache) as a reverse proxy for our application servers. For performance reasons we serve static content (.gif, .jpg, .css, .html etc.) from our http servers, to ease the burden a bit from the application server. So far, we have to distribute files to http server and configure it manually (writing custom scripts at best.) The problem is the effort needed to keep everything in synch, especially when you need to update the app. Does any Java EE product support this “out of the box”? Is there a way to have application server do this automatically, like in cluster configuration for example, where master node is in charge of distributing the application to other nodes and for keeping everything in synch.

    Read the article

  • Is it possible to have 'sub-templates' when using MailDefinition

    - by Dan
    I am using the MailDefinition class to create html emails for my site. The only problem I am having is that there is alot of repetition in the string templates. For example the email footer along with all the associated html and css has to be repeated in each template type. Is there a way to have sub-template? or some mechanism for avoiding this repetition?

    Read the article

  • Custom DataGridView column sort based on Value not Formatted value

    - by Dan Neely
    I have a custom DGV cell I'm using to display the contents of MyType objects. To control how they're being formatted I'm overriding the GetFormattedValue() and FormattedvalueType methods of DataGridViewTextBoxCell because in this case I don't want to use the default ToString() method. The problem is that when I do this the DGV is sorting the column by the string in FormattedValue instead of by Value. I'm not seeing a method I can override to change the sort behavior of the column. While I know I can, I don't want to have to write custom Sort mthods for the DGVs themselves because I'm using this in multiple DGV's.

    Read the article

  • How do I pass a DBNull value to a parameterized SELECT statement?

    - by Dan
    I have a SQL statement in C# (.NET Framework 4 running against SQL Server 2k8) that looks like this: SELECT [Column1] FROM [Table1] WHERE [Column2] = @Column2 The above query works fine with the following ADO.NET code: DbParameter parm = Factory.CreateDbParameter(); parm.Value = "SomeValue"; parm.ParameterName = "@Column2"; //etc... This query returns zero rows, though, if I assign DBNull.Value to the DbParameter's Value member even if there are null values in Column2. If I change the query to accommodate the null test specifically: SELECT [Column1] FROM [Table1] WHERE [Column2] IS @Column2 I get an "Incorrect syntax near '@Column2'" exception at runtime. Is there no way that I can use null or DBNull as a parameter in the WHERE clause of a SELECT statement?

    Read the article

  • Is it possible for a XSS attack to obtain HttpOnly cookies?

    - by Dan Herbert
    Reading this blog post about HttpOnly cookies made me start thinking, is it possible for an HttpOnly cookie to be obtained through any form of XSS? Jeff mentions that it "raises the bar considerably" but makes it sound like it doesn't completely protect against XSS. Aside from the fact that not all browser support this feature properly, how could a hacker obtain a user's cookies if they are HttpOnly? I can't think of any way to make an HttpOnly cookie send itself to another site or be read by script, so it seems like this is a safe security feature, but I'm always amazed at how easily some people can work around many security layers. In the environment I work in, we use IE exclusively so other browsers aren't a concern. I'm looking specifically for other ways that this could become an issue that don't rely on browser specific flaws.

    Read the article

  • How can I get an IObservable<T> in Rx from a "non-standard" event?

    - by Dan Tao
    Here's what I mean. Suppose I'm working with an API that exposes events, but these events do not follow the standard EventHandler or EventHandler<TEventArgs> signature. One event might look like this, for instance: Public Event Update(ByVal sender As BaseSubscription, ByVal e As BaseEvent) Now, typically, if I want to get an IObservable<TEventArgs> from an event, I can just do this: Dim updates = Observable.FromEvent(Of UpdateEventArgs)( _ target:=updateSource, _ eventName:="Update" _ ) But this doesn't work, because the Update event is not an EventHandler<UpdateEventArgs> -- in fact, there is no UpdateEventArgs -- it's basically just its own thing. Obviously, I could define my own class deriving from EventArgs (i.e., UpdateEventArgs), write another class to wrap the object providing the Update event, give the wrapper class its own Update event that is an EventHandler<UpdateEventArgs>, and get an IObservable<UpdateEventArgs> from that. But that's an annoying amount of work. Is there some way to create an IObservable<[something]> from a "non-standard" event like this, or am I out of luck?

    Read the article

  • Javascript/jQuery: programmatically follow a link

    - by Dan
    In Javascript code, I would like to programmatically cause the browser to follow a link that's on my page. Simple case: <a id="foo" href="mailto:[email protected]">something</a> function goToBar() { $('#foo').trigger('follow'); } This is hypothetical as it doesn't actually work. And no, triggering click doesn't do it. I am aware of window.location and window.open but these differ from native link-following in some ways that matter to me: a) in the presence of a <base /> element, and b) in the case of mailto URLs. The latter in particular is significant. In Firefox at least, calling window.location.href = "mailto:[email protected]" causes the window's unload handlers to fire, whereas simply clicking a mailto link does not, as far as I can tell. I'm looking for a way to trigger the browser's default handling of links, from Javascript code. Does such a mechanism exist? Toolkit-specific answers also welcome (especially for Gecko).

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >