Daily Archives

Articles indexed Sunday May 2 2010

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

  • ASP.NET MVC and ViewState

    - by nickyt
    Now I've seen some questions like this, but it's not exactly what I want to ask, so for all those screaming duplicate, I apologize :). I've barely touched ASP.NET MVC but from what I understand there is no ViewState/ControlState... fine. So my question is what is the alternative to retaining a control's state? Do we go back to old school ASP where we might simulate what ASP.NET ViewState/ControlState does by creating hidden form inputs with the control's state, or with MVC, do we just assume AJAX always and retain all state client-side and make AJAX calls to update? This question has some answers, http://stackoverflow.com/questions/1285547/maintaining-viewstate-in-asp-net-mvc, but not exactly what I'm looking for in an answer. UPDATE: Thanks for all the answers so far. Just to clear up what I'm not looking for and what I'm looking for: Not looking for: Session solution Cookie solution Not looking to mimic WebForms in MVC What I am/was looking for: A method that only retains the state on postback if data is not rebound to a control. Think WebForms with the scenario of only binding a grid on the initial page load, i.e. only rebinding the data when necessary. As I mentioned, I'm not trying to mimic WebForms, just wondering what mechanisms MVC offers.

    Read the article

  • Get name given a phone number on the iPhone

    - by ganti
    I'm using a TextField where the user types a phone number. When the TextField changes, it should check if this number is already in the phonebook and display the name. So far, my only way is to parse all names and number in a Dict and read it from there. Is there a simpler, more efficient and sophisticated way to do that?

    Read the article

  • How to uninstall files and software from a Solid State Drive (SSD)

    - by jasondavis
    I am using a SSD drive just as a main Operation system and software drive. I have a regular spinning disk for data files. I have read that files are not REALLY deleted from a SSD drive when you "delete" them. So here is my situation and hopefully I can get some good advice. Let's say I have Windows 7 Pro x64bit installed on my 80gb Intel SSD. I then have Adobe Photoshop CS4 installed along with 50 other programs installed onto this SSD. I then decide I am done with Adobe Phjotoshop CS4 and want to remove it. I then decide I want to install another version of Adobe Photoshop and a few other software titles. Would I just do the usual, add/remove software from the windows control panel. Or if the software being removed has an "Uninstall" program to run, then run it and uninstall the software? I realize that all this WILL remove the software from Windows 7 but I am wanting to know if there is additional steps that should be taken since it is a solid state drive (SSD)?

    Read the article

  • iPhone/iPad: Get Alerts When Paid Apps Go Free

    - by Gopinath
    iPhone users has thousands of cool applications to choose. These apps are either paid or absolutely free. Many of the paid applications goes free for either a limited time or forever depending on the mood of their developers. Will it not be cool to get alerts whenever a paid app goes free? Yeah, it will be great. Free App Alert is a handy website that checks iTunes store regularly and sends alerts to it’s subscribers about the apps that have gone from paid to free. You can receive the alerts by following them on twitter, facebook or subscribing to the traditional RSS feeds(yeah RSS is a traditional technology). The home page of this website shows the apps that have gone free today and you can browse through the previous day free apps listing with the help of links available at the bottom. Free App Alert is definitely a cool site to check out for iPhone/iPod/iPad users and certainly easier than scrolling through iTunes store and checking prices. Tip: Immediately download the app that have gone from paid to free as many apps are free for limited time. You can see many free apps going back to paid version if you go through the previous pages the website. Join us on Facebook to read all our stories right inside your Facebook news feed.

    Read the article

  • C# BinarySearch breaks when inheriting from something that implements IComparable<T>?

    - by Ender
    In .NET the BinarySearch algorithm (in Lists, Arrays, etc.) appears to fail if the items you are trying to search inherit from an IComparable instead of implementing it directly: List<B> foo = new List<B>(); // B inherits from A, which implements IComparable<A> foo.Add(new B()); foo.BinarySearch(new B()); // InvalidOperationException, "Failed to compare two elements in the array." Where: public abstract class A : IComparable<A> { public int x; public int CompareTo(A other) { return x.CompareTo(other.x); } } public class B : A {} Is there a way around this? Implementing CompareTo(B other) in class B doesn't seem to work.

    Read the article

  • Help with these warnings. [inheritance].

    - by sil3nt
    Hello there. I have a set of code, which mimics a basic library cataloging system. There is a base class named items, in which the the general id,title and year variables are defined and 3 other derived classes (DVD,Book and CD). Base [Items] Derived [DVD,Book,CD]. The programs runs, however I get the following warnings, I'm not sure how to fix these. "C:\Program Files\gcc\bin/g++" -Os -mconsole -g -Wall -Wshadow -fno-common mainA4.cpp -o mainA4.exe In file included from mainA4.cpp:5: a4.h: In constructor `DVD::DVD(int, std::string, int, std::string)': a4.h:28: warning: `DVD::director' will be initialized after a4.h:32: warning: base `Items' a4.h:32: warning: when initialized here a4.h: In constructor `Book::Book(int, std::string, int, std::string, int)': a4.h:48: warning: `Book::numPages' will be initialized after a4.h:52: warning: base `Items' a4.h:52: warning: when initialized here a4.h: In constructor `CD::CD(int, std::string, int, std::string, int)': a4.h:66: warning: `CD::numSongs' will be initialized after a4.h:70: warning: base `Items' a4.h:70: warning: when initialized here Exit code: 0

    Read the article

  • How you would you describe the Observer pattern in beginner language?

    - by Sheldon
    Currently, my level of understanding is below all the coding examples on the web about the Observer Pattern. I understand it simply as being almost a subscription that updates all other events when a change is made that the delegate registers. However, I'm very unstable in my true comprehension of the benefits and uses. I've done some googling, but most are above my level of understanding. I'm trying to implement this pattern with my current homework assignment, and to truly make sense on my project need a better understanding of the pattern itself and perhaps an example to see what its use. I don't want to force this pattern into something just to submit, I need to understand the purpose and develop my methods accordingly so that it actually serves a good purpose. My text doesn't really go into it, just mentions it in one sentence. MSDN was hard for me to understand, as I'm a beginner on this, and it seems more of an advanced topic. How would you describe this Observer pattern and its uses in C# to a beginner? For an example, please keep code very simple so I can understand the purpose more than complex code snippets. I'm trying to use it effectively with some simple textbox string manipulations and using delegates for my assignment, so a pointer would help!

    Read the article

  • Autoconf -- including a static library (newbie)

    - by EB
    I am trying to migrate my application from manual build to autoconf, which is working very nicely so far. But I have one static library that I can't figure out how to integrate. That library will NOT be located in the usual library locations - the location of the binary (.a file) and header (.h file) will be given as a configure argument. (Notably, even if I move the .a file to /usr/lib or anywhere else I can think of, it still won't work.) It is also not named traditionally (it does not start with "lib" or "l"). Manual compilation is working with these (directory is not predictable - this is just an example): gcc ... -I/home/john/mystuff /home/john/mystuff/helper.a (Uh, I actually don't understand why the .a file is referenced directly, not with -L or anything. Yes, I have a half-baked understanding of building C programs.) So, in my configure.ac, I can use the relevant configure argument to successfully find the header (.h file) using AC_CHECK_HEADER. Inside the AC_CHECK_HEADER I then add the location to CPFLAGS and the #include of the header file in the actual C code picks it up nicely. Given a configure argument that has been put into $location and the name of the needed files are helper.h and helper.a (which are both in the same directory), here is what works so far: AC_CHECK_HEADER([$location/helper.h], [AC_DEFINE([HAVE_HELPER_H], [1], [found helper.h]) CFLAGS="$CFLAGS -I$location"]) Where I run into difficulties is getting the binary (.a file) linked in. No matter what I try, I always get an error about undefined references to the function calls for that library. I'm pretty sure it's a linkage issue, because I can fuss with the C code and make an intentional error in the function calls to that library which produces earlier errors that indicate that the function prototypes have been loaded and used to compile. I tried adding the location that contains the .a file to LDFLAGS and then doing a AC_CHECK_LIB but it is not found. Maybe my syntax is wrong, or maybe I'm missing something more fundamental, which would not be surprising since I'm a newbie and don't really know what I'm doing. Here is what I have tried: AC_CHECK_HEADER([$location/helper.h], [AC_DEFINE([HAVE_HELPER_H], [1], [found helper.h]) CFLAGS="$CFLAGS -I$location"; LDFLAGS="$LDFLAGS -L$location"; AC_CHECK_LIB(helper)]) No dice. AC_CHECK_LIB is looking for -lhelper I guess (or libhelper?) so I'm not sure if that's a problem, so I tried this, too (omit AC_CHECK_LIB and include the .a directly in LDFLAGS), without luck: AC_CHECK_HEADER([$location/helper.h], [AC_DEFINE([HAVE_HELPER_H], [1], [found helper.h]) CFLAGS="$CFLAGS -I$location"; LDFLAGS="$LDFLAGS -L$location/helper.a"]) To emulate the manual compilation, I tried removing the -L but that doesn't help: AC_CHECK_HEADER([$location/helper.h], [AC_DEFINE([HAVE_HELPER_H], [1], [found helper.h]) CFLAGS="$CFLAGS -I$location"; LDFLAGS="$LDFLAGS $location/helper.a"]) I tried other combinations and permutations, but I think I might be missing something more fundamental....

    Read the article

  • How to store private pictures and videos in Ruby on Rails

    - by TK
    Here's a story: User A should be able to upload an image. User A should be able to set a privacy. ("Public" or "Private"). User B should not be able to access "Private" images of User A. I'm planning to user Paperclip for dealing with uploads. If I store the images under "RAILS_ROOT/public/images", anyone who could guess the name of the files might access the files. (e.g., accessing http://example.com/public/images/uploads/john/family.png ) I need to show the images using img tags, so I cannot place a file except public. How can I ensure that images of a user or group is not accessible by others?

    Read the article

  • curl not returning content length header

    - by Michael P. Shipley
    Trying to get image file size using curl but content length header is not returned: $url ="http://www.collegefashion.net/wp-content/plugins/feed-comments-number/image.php?1263"; $fp = curl_init(); curl_setopt($fp, CURLOPT_NOBODY, true); curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1); curl_setopt($fp, CURLOPT_FAILONERROR,1); curl_setopt($fp, CURLOPT_REFERER,''); curl_setopt($fp, CURLOPT_URL, $url); curl_setopt($fp, CURLOPT_HEADER,1); curl_setopt($fp, CURLOPT_USERAGENT,'Mozilla/5.0'); $body = curl_exec($fp); var_dump($body): HTTP/1.1 200 OK Date: Sun, 02 May 2010 02:50:20 GMT Server: Apache/2.0.63 (CentOS) X-Powered-By: W3 Total Cache/0.8.5.2 X-Pingback: http://www.collegefashion.net/xmlrpc.php Cache-Control: no-cache, must-revalidate Expires: Sat, 26 Jul 1997 05:00:00 GMT Content-Type: image/png It works via ssh though: curl -i http://www.collegefashion.net/wp-content/plugins/feed-comments-number/image.php?1263 HTTP/1.1 200 OK Date: Sun, 02 May 2010 03:38:43 GMT Server: Apache/2.0.63 (CentOS) X-Powered-By: W3 Total Cache/0.8.5.2 X-Pingback: http://www.collegefashion.net/xmlrpc.php Cache-Control: no-cache, must-revalidate Expires: Sat, 26 Jul 1997 05:00:00 GMT Content-Length: 347 Content-Type: image/png

    Read the article

  • Methods to stop Software Piracy ?

    - by UK
    I am great fan of open source technologies. I have seen lot of sites which offers pirated software's.My question is , Suppose If you are software developer and wants to sell your product and stop piracy of your products which are all the techniques or methods you use ? Is there any standard software's or standard techniques available ? The best example is Microsoft Windows WPA activation .

    Read the article

  • Problem running java code through command line

    - by kunjaan
    I have a simple Class package chapter10; public class CompilationTest { public static void main(String[] args) { System.out.println("HELLO WORLD"); } } The path is Test\src\chapter10\CompilationTest.java I successfully compiled the code into the same folder and now I have Test\src\chapter10\CompilationTest.class However when I try to run from the same folder it I get this error >java CompilationTest Exception in thread "main" java.lang.NoClassDefFoundError: CompilationTest (wrong name: chapter10/CompilationTest) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: CompilationTest. Program will exit. When I run using >java chapter10/PropertiesTest Exception in thread "main" java.lang.NoClassDefFoundError: chapter10/PropertiesTest Caused by: java.lang.ClassNotFoundException: chapter10.PropertiesTest at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: chapter10/PropertiesTest. Program will exit.

    Read the article

  • Android browser GREEN border on click...

    - by Paul
    Hi, I want to develop a web application using HTML, CSS and Javascript one thing that is really annoying is that any link or button etc when clicked inside the Android browser gets highlighted with a green border. To demonstrate what I mean I have included a link to a page that contains a basic game written in CSS http://marbles2.com/app/ Is there any way that you are aware of to disable the click green border? Cheers Paul

    Read the article

  • NSUndoManager with Core Data - Redo not working

    - by CJ
    I have a Core Data document-based app which support undo/redo via the built-in NSUndoManager associated with the NSManagedObjectContext. I have a few actions set up which perform numerous tasks within Core Data, wrap all these tasks into an undo group via beginUndoGrouping/endUndoGrouping, and are processed by the NSUndoManager. Undo works fine. I can perform several successive actions, and each then undo each one of them successively and my app's state is maintained correctly. However, the "Redo" menu item is never enabled. This means that the NSUndoManager is telling the menu that there are no items to redo. I am wondering why the NSUndoManager is seemingly forgetting about items once they are undone, and not allowing redos to occur? One thing I should mention is that I'm disabling undo registration after a document is opened/created. When I perform an action, I call enableUndoRegistration, beginUndoGrouping, perform the action, then call processPendingChanges, setActionName:, endUndoGrouping, and finally disableUndoRegistration. This makes sure that only specific actions are undoable, and any other data changes I make outside of these go unnoticed to the NSUndoManager. This may be a part of the issue, but if so I'm wondering why it's affecting redo? Thanks in advance.

    Read the article

  • Playing audiobooks in Windows. [closed]

    - by Phenom
    Possible Duplicate: What media player application can remember where you last paused/stopped the track? My audiobooks are in mp3 format. Each chapter is a file. Sometimes I will stop playing in the middle of a file. When I click on the file again I want to continue where I left off. That's what my ipod touch does. But for Windows, are there any programs that can do that?

    Read the article

  • media player or dj software

    - by Dale
    Been searching for quite some time for a player that will cross fade correctly. What I mean by that, most players have the ability to start fading with a given time left of the song (ex:10 secs) While at times that can be fine, but is there software or a plugin for software that can tell the difference between a song that fades out, or a song that has a cold ending? So far the best one out there that I have tested is PCDJ, but I am sure there has to be something that can distinguish between endings of songs. Should add...this is for windows. Running vista Thanks in advance

    Read the article

  • floating exception using icc compiler

    - by Hristo
    I'm compiling my code via the following command: icc -ltbb test.cxx -o test Then when I run the program: time ./mp6 100 > output.modified Floating exception 4.871u 0.405s 0:05.28 99.8% 0+0k 0+0io 0pf+0w I get a "Floating exception". This following is code in C++ that I had before the exception and after: // before if (j < E[i]) { temp += foo(0, trr[i], ex[i+j*N]); } // after temp += (j < E[i])*foo(0, trr[i], ex[i+j*N]); This is boolean algebra... so (j < E[i]) is either going to be a 0 or a 1 so the multiplication would result either in 0 or the foo() result. I don't see why this would cause a floating exception. This is what foo() does: int foo(int s, int t, int e) { switch(s % 4) { case 0: return abs(t - e)/e; case 1: return (t == e) ? 0 : 1; case 2: return (t < e) ? 5 : (t - e)/t; case 3: return abs(t - e)/t; } return 0; } foo() isn't a function I wrote so I'm not too sure as to what it does... but I don't think the problem is with the function foo(). Is there something about boolean algebra that I don't understand or something that works differently in C++ than I know of? Any ideas why this causes an exception? Thanks, Hristo

    Read the article

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